windmill-components 1.511.1 → 1.531.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 (446) hide show
  1. package/package/components/AIAgentLogViewer.svelte +123 -0
  2. package/package/components/AIAgentLogViewer.svelte.d.ts +13 -0
  3. package/package/components/AppConnectInner.svelte +10 -10
  4. package/package/components/AppConnectInner.svelte.d.ts +1 -1
  5. package/package/components/ArgInput.svelte +42 -14
  6. package/package/components/ArgInput.svelte.d.ts +2 -10
  7. package/package/components/AssignableTagsInner.svelte +5 -0
  8. package/package/components/AuthSettings.svelte +4 -2
  9. package/package/components/AuthSettings.svelte.d.ts +1 -0
  10. package/package/components/AutoscalingConfigEditor.svelte +76 -2
  11. package/package/components/DBManagerDrawer.svelte +154 -151
  12. package/package/components/DBManagerDrawer.svelte.d.ts +2 -2
  13. package/package/components/DBTable.svelte +3 -3
  14. package/package/components/DBTable.svelte.d.ts +1 -0
  15. package/package/components/DBTableEditor.svelte +7 -7
  16. package/package/components/DBTableEditor.svelte.d.ts +1 -1
  17. package/package/components/DeployWorkspace.svelte +1 -1
  18. package/package/components/Dev.svelte +12 -28
  19. package/package/components/DiffEditor.svelte +6 -3
  20. package/package/components/DiffEditor.svelte.d.ts +1 -0
  21. package/package/components/DisplayResult.svelte +46 -14
  22. package/package/components/DisplayResult.svelte.d.ts +5 -1
  23. package/package/components/DynSelect.svelte +58 -34
  24. package/package/components/DynSelect.svelte.d.ts +3 -11
  25. package/package/components/EditableSchemaForm.svelte +131 -8
  26. package/package/components/EditableSchemaForm.svelte.d.ts +5 -1
  27. package/package/components/Editor.svelte +27 -9
  28. package/package/components/Editor.svelte.d.ts +1 -1
  29. package/package/components/EditorBar.svelte +105 -7
  30. package/package/components/EditorSettings.svelte +6 -0
  31. package/package/components/ErrorOrRecoveryHandler.svelte +76 -8
  32. package/package/components/ErrorOrRecoveryHandler.svelte.d.ts +2 -1
  33. package/package/components/ExploreAssetButton.svelte +14 -4
  34. package/package/components/ExploreAssetButton.svelte.d.ts +1 -0
  35. package/package/components/FirstStepInputs.svelte +2 -2
  36. package/package/components/FlowBuilder.svelte +18 -36
  37. package/package/components/FlowGraphViewerStep.svelte +7 -0
  38. package/package/components/FlowJobResult.svelte +16 -64
  39. package/package/components/FlowJobResult.svelte.d.ts +11 -4
  40. package/package/components/FlowLogViewer.svelte +660 -0
  41. package/package/components/FlowLogViewer.svelte.d.ts +34 -0
  42. package/package/components/FlowLogViewerWrapper.svelte +52 -0
  43. package/package/components/FlowLogViewerWrapper.svelte.d.ts +21 -0
  44. package/package/components/FlowLoopIterationPreview.svelte +3 -3
  45. package/package/components/FlowPreviewContent.svelte +13 -6
  46. package/package/components/FlowPreviewContent.svelte.d.ts +7 -7
  47. package/package/components/FlowPreviewResult.svelte +7 -5
  48. package/package/components/FlowPreviewResult.svelte.d.ts +4 -5
  49. package/package/components/FlowStatusViewer.svelte +28 -16
  50. package/package/components/FlowStatusViewer.svelte.d.ts +19 -27
  51. package/package/components/FlowStatusViewerInner.svelte +500 -295
  52. package/package/components/FlowStatusViewerInner.svelte.d.ts +34 -34
  53. package/package/components/FlowTimeline.svelte +11 -13
  54. package/package/components/FlowTimeline.svelte.d.ts +6 -5
  55. package/package/components/FolderEditor.svelte +1 -1
  56. package/package/components/GitDiffPreview.svelte +14 -18
  57. package/package/components/GitDiffPreview.svelte.d.ts +2 -8
  58. package/package/components/GitHubAppIntegration.svelte +3 -1
  59. package/package/components/HighlightCode.svelte +4 -1
  60. package/package/components/IconedResourceType.svelte +9 -5
  61. package/package/components/IdEditorInput.svelte +25 -22
  62. package/package/components/IdEditorInput.svelte.d.ts +11 -23
  63. package/package/components/InstanceSetting.svelte +7 -2
  64. package/package/components/InstanceSettings.svelte +1 -0
  65. package/package/components/JobLoader.svelte +108 -12
  66. package/package/components/JobLoader.svelte.d.ts +16 -3
  67. package/package/components/LogViewer.svelte +8 -2
  68. package/package/components/LogViewer.svelte.d.ts +1 -0
  69. package/package/components/LogViewerHeader.svelte +32 -0
  70. package/package/components/LogViewerHeader.svelte.d.ts +8 -0
  71. package/package/components/Login.svelte +8 -2
  72. package/package/components/MemoryFootprintViewer.svelte +1 -1
  73. package/package/components/ModulePreviewForm.svelte +10 -6
  74. package/package/components/ModulePreviewResultViewer.svelte +18 -2
  75. package/package/components/ModulePreviewResultViewer.svelte.d.ts +1 -1
  76. package/package/components/ModuleTest.svelte +59 -16
  77. package/package/components/MoveDrawer.svelte.d.ts +2 -2
  78. package/package/components/NextcloudSetting.svelte +84 -0
  79. package/package/components/NextcloudSetting.svelte.d.ts +7 -0
  80. package/package/components/ObjectResourceInput.svelte +3 -2
  81. package/package/components/ObjectResourceInput.svelte.d.ts +1 -0
  82. package/package/components/ParqetCsvTableRenderer.svelte +1 -1
  83. package/package/components/RelativeLineNumbers.svelte +16 -0
  84. package/package/components/RelativeLineNumbers.svelte.d.ts +18 -0
  85. package/package/components/ResourceEditor.svelte +10 -5
  86. package/package/components/ResourcePicker.svelte +8 -1
  87. package/package/components/ResourcePicker.svelte.d.ts +1 -0
  88. package/package/components/ResultStreamDisplay.svelte +5 -0
  89. package/package/components/ResultStreamDisplay.svelte.d.ts +5 -0
  90. package/package/components/RunForm.svelte +9 -1
  91. package/package/components/SchemaForm.svelte +2 -2
  92. package/package/components/SchemaForm.svelte.d.ts +2 -10
  93. package/package/components/ScriptBuilder.svelte +26 -19
  94. package/package/components/ScriptBuilder.svelte.d.ts +1 -1
  95. package/package/components/ScriptEditor.svelte +2 -2
  96. package/package/components/ScriptEditor.svelte.d.ts +1 -1
  97. package/package/components/ScriptWrapper.svelte +1 -1
  98. package/package/components/ShareModal.svelte.d.ts +1 -1
  99. package/package/components/SimpleAgTable.svelte +2 -0
  100. package/package/components/SimpleAgTable.svelte.d.ts +2 -0
  101. package/package/components/SimpleEditor.svelte +10 -4
  102. package/package/components/SimpleEditor.svelte.d.ts +1 -0
  103. package/package/components/SqlRepl.svelte +21 -7
  104. package/package/components/SqlRepl.svelte.d.ts +2 -2
  105. package/package/components/StringTypeNarrowing.svelte.d.ts +1 -1
  106. package/package/components/TemplateEditor.svelte +1 -1
  107. package/package/components/UserSettings.svelte +4 -4
  108. package/package/components/WorkerTagSelect.svelte +70 -1
  109. package/package/components/apps/components/display/AppAccordionList.svelte +1 -1
  110. package/package/components/apps/components/display/AppCarouselList.svelte +10 -8
  111. package/package/components/apps/components/display/AppDisplayComponent.svelte +13 -1
  112. package/package/components/apps/components/display/AppJobIdFlowStatus.svelte +3 -3
  113. package/package/components/apps/components/display/AppText.svelte +2 -2
  114. package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +8 -1
  115. package/package/components/apps/components/display/dbtable/InsertRow.svelte +5 -4
  116. package/package/components/apps/components/display/dbtable/queries/count.js +11 -1
  117. package/package/components/apps/components/display/dbtable/queries/createTable.d.ts +1 -1
  118. package/package/components/apps/components/display/dbtable/queries/createTable.js +3 -3
  119. package/package/components/apps/components/display/dbtable/queries/delete.js +7 -0
  120. package/package/components/apps/components/display/dbtable/queries/insert.js +2 -0
  121. package/package/components/apps/components/display/dbtable/queries/select.js +14 -0
  122. package/package/components/apps/components/display/dbtable/queries/update.js +7 -0
  123. package/package/components/apps/components/display/dbtable/utils.d.ts +6 -5
  124. package/package/components/apps/components/display/dbtable/utils.js +52 -28
  125. package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte +1 -1
  126. package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +1 -0
  127. package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte.d.ts +1 -0
  128. package/package/components/apps/components/display/table/AppAggridTable.svelte +7 -6
  129. package/package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +1 -0
  130. package/package/components/apps/components/display/table/utils.js +7 -4
  131. package/package/components/apps/components/helpers/HiddenComponent.svelte +2 -3
  132. package/package/components/apps/components/helpers/InputValue.svelte +6 -1
  133. package/package/components/apps/components/helpers/NonRunnableComponent.svelte +8 -4
  134. package/package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -1
  135. package/package/components/apps/components/helpers/RunnableComponent.svelte +10 -8
  136. package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +3 -2
  137. package/package/components/apps/components/helpers/RunnableWrapper.svelte +12 -3
  138. package/package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -1
  139. package/package/components/apps/components/inputs/AppCodeInputComponent.svelte +0 -5
  140. package/package/components/apps/components/inputs/AppS3FileInput.svelte +2 -2
  141. package/package/components/apps/components/layout/AppConditionalWrapper.svelte +1 -1
  142. package/package/components/apps/components/layout/AppContainer.svelte +1 -1
  143. package/package/components/apps/components/layout/AppDecisionTree.svelte +32 -21
  144. package/package/components/apps/components/layout/AppDrawer.svelte +1 -1
  145. package/package/components/apps/components/layout/AppList.svelte +9 -8
  146. package/package/components/apps/components/layout/AppModal.svelte +1 -1
  147. package/package/components/apps/components/layout/AppSplitpanes.svelte +5 -2
  148. package/package/components/apps/components/layout/AppStepper.svelte +10 -6
  149. package/package/components/apps/components/layout/AppTabs.svelte +3 -3
  150. package/package/components/apps/editor/AppEditorHeader.svelte +13 -2
  151. package/package/components/apps/editor/AppJobsDrawer.svelte +2 -2
  152. package/package/components/apps/editor/GridEditor.svelte +24 -19
  153. package/package/components/apps/editor/GridEditor.svelte.d.ts +4 -1
  154. package/package/components/apps/editor/GridViewer.svelte +1 -0
  155. package/package/components/apps/editor/RunnableJobPanelInner.svelte +2 -1
  156. package/package/components/apps/editor/SubGridEditor.svelte +7 -11
  157. package/package/components/apps/editor/SubGridEditor.svelte.d.ts +3 -19
  158. package/package/components/apps/editor/appUtils.js +17 -68
  159. package/package/components/apps/editor/component/ComponentInner.svelte +845 -694
  160. package/package/components/apps/editor/component/componentCallbacks.svelte.js +8 -1
  161. package/package/components/apps/editor/contextPanel/components/IdEditor.svelte +7 -7
  162. package/package/components/apps/editor/contextPanel/components/IdEditor.svelte.d.ts +7 -19
  163. package/package/components/apps/editor/contextPanel/components/OutputHeader.svelte +14 -55
  164. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte.d.ts +1 -1
  165. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditorDrawer.svelte.d.ts +1 -1
  166. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptRunnableByPath.svelte.d.ts +1 -1
  167. package/package/components/apps/editor/settingsPanel/DecisionTreeGraphEditor.svelte +31 -45
  168. package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
  169. package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +1 -0
  170. package/package/components/apps/editor/settingsPanel/decisionTree/DecisionTreePreview.svelte +1 -3
  171. package/package/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte +2 -2
  172. package/package/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte.d.ts +1 -0
  173. package/package/components/apps/svelte-grid/Grid.svelte +23 -25
  174. package/package/components/apps/svelte-grid/Grid.svelte.d.ts +21 -9
  175. package/package/components/apps/svelte-grid/MoveResize.svelte +13 -15
  176. package/package/components/apps/svelte-grid/MoveResize.svelte.d.ts +17 -24
  177. package/package/components/apps/utils.d.ts +2 -0
  178. package/package/components/apps/utils.js +22 -0
  179. package/package/components/assets/AssetsDropdownButton.svelte +1 -1
  180. package/package/components/assets/JobAssetsViewer.svelte +2 -2
  181. package/package/components/assets/lib.js +4 -0
  182. package/package/components/auditLogs/AuditLogsFilters.svelte +7 -9
  183. package/package/components/auditLogs/AuditLogsFilters.svelte.d.ts +1 -1
  184. package/package/components/common/button/Button.svelte +4 -3
  185. package/package/components/common/button/Button.svelte.d.ts +1 -0
  186. package/package/components/common/confirmationModal/ConfirmationModal.svelte +6 -5
  187. package/package/components/common/confirmationModal/ConfirmationModal.svelte.d.ts +6 -11
  188. package/package/components/common/confirmationModal/asyncConfirmationModal.svelte.d.ts +26 -0
  189. package/package/components/common/confirmationModal/asyncConfirmationModal.svelte.js +50 -0
  190. package/package/components/common/fileDownload/FileDownload.svelte +1 -3
  191. package/package/components/common/fileDownload/FileDownload.svelte.d.ts +4 -18
  192. package/package/components/common/languageIcons/LanguageIcon.svelte +5 -2
  193. package/package/components/common/modal/Modal.svelte +2 -5
  194. package/package/components/common/tabs/TabsV2.svelte +2 -1
  195. package/package/components/common/tabs/TabsV2.svelte.d.ts +1 -0
  196. package/package/components/copilot/FlowInlineScriptAIButton.svelte +58 -0
  197. package/package/components/copilot/FlowInlineScriptAIButton.svelte.d.ts +3 -0
  198. package/package/components/copilot/MetadataGen.svelte +19 -1
  199. package/package/components/copilot/MetadataGen.svelte.d.ts +1 -1
  200. package/package/components/copilot/ScriptGen.svelte +23 -31
  201. package/package/components/copilot/ScriptGen.svelte.d.ts +0 -1
  202. package/package/components/copilot/autocomplete/Autocompletor.js +2 -0
  203. package/package/components/copilot/chat/AIChatDisplay.svelte +4 -4
  204. package/package/components/copilot/chat/AIChatInput.svelte +29 -6
  205. package/package/components/copilot/chat/AIChatManager.svelte.js +171 -33
  206. package/package/components/copilot/chat/AIChatMessage.svelte +3 -0
  207. package/package/components/copilot/chat/ContextTextarea.svelte +1 -1
  208. package/package/components/copilot/chat/ToolContentDisplay.svelte +84 -0
  209. package/package/components/copilot/chat/ToolContentDisplay.svelte.d.ts +11 -0
  210. package/package/components/copilot/chat/ToolExecutionDisplay.svelte +105 -0
  211. package/package/components/copilot/chat/ToolExecutionDisplay.svelte.d.ts +7 -0
  212. package/package/components/copilot/chat/api/apiTools.d.ts +7 -0
  213. package/package/components/copilot/chat/api/apiTools.js +192 -0
  214. package/package/components/copilot/chat/api/core.d.ts +7 -0
  215. package/package/components/copilot/chat/api/core.js +61 -0
  216. package/package/components/copilot/chat/flow/FlowAIChat.svelte +4 -6
  217. package/package/components/copilot/chat/flow/core.js +213 -42
  218. package/package/components/copilot/chat/flow/utils.js +3 -0
  219. package/package/components/copilot/chat/monaco-adapter.d.ts +1 -1
  220. package/package/components/copilot/chat/monaco-adapter.js +10 -4
  221. package/package/components/copilot/chat/navigator/core.d.ts +1 -1
  222. package/package/components/copilot/chat/navigator/core.js +20 -22
  223. package/package/components/copilot/chat/script/core.d.ts +11 -3
  224. package/package/components/copilot/chat/script/core.js +120 -44
  225. package/package/components/copilot/chat/shared.d.ts +31 -4
  226. package/package/components/copilot/chat/shared.js +235 -10
  227. package/package/components/copilot/lib.d.ts +1 -1
  228. package/package/components/copilot/lib.js +15 -6
  229. package/package/components/custom_ui.d.ts +4 -0
  230. package/package/components/dbOps.d.ts +20 -8
  231. package/package/components/dbOps.js +85 -40
  232. package/package/components/details/DetailPageHeader.svelte +0 -2
  233. package/package/components/details/DetailPageLayout.svelte +34 -33
  234. package/package/components/flow_builder.d.ts +1 -2
  235. package/package/components/flows/FlowEditor.svelte +3 -3
  236. package/package/components/flows/FlowEditor.svelte.d.ts +7 -6
  237. package/package/components/flows/common/FlowCard.svelte +2 -2
  238. package/package/components/flows/common/FlowCard.svelte.d.ts +1 -0
  239. package/package/components/flows/common/FlowCardHeader.svelte +13 -4
  240. package/package/components/flows/common/FlowCardHeader.svelte.d.ts +1 -0
  241. package/package/components/flows/content/BranchPredicateEditor.svelte +4 -7
  242. package/package/components/flows/content/BranchPredicateEditor.svelte.d.ts +12 -11
  243. package/package/components/flows/content/FlowConstants.svelte +3 -3
  244. package/package/components/flows/content/FlowEditorPanel.svelte +3 -3
  245. package/package/components/flows/content/FlowEditorPanel.svelte.d.ts +2 -4
  246. package/package/components/flows/content/FlowInput.svelte +5 -0
  247. package/package/components/flows/content/FlowInputsQuick.svelte +2 -1
  248. package/package/components/flows/content/FlowLoop.svelte +2 -2
  249. package/package/components/flows/content/FlowModuleComponent.svelte +130 -108
  250. package/package/components/flows/content/FlowModuleComponent.svelte.d.ts +1 -0
  251. package/package/components/flows/content/FlowModuleEarlyStop.svelte +2 -2
  252. package/package/components/flows/content/FlowModuleScript.svelte +0 -1
  253. package/package/components/flows/content/FlowModuleSkip.svelte +1 -1
  254. package/package/components/flows/content/FlowModuleSleep.svelte +1 -1
  255. package/package/components/flows/content/FlowModuleSuspend.svelte +1 -1
  256. package/package/components/flows/content/FlowModuleWrapper.svelte +15 -5
  257. package/package/components/flows/content/FlowModuleWrapper.svelte.d.ts +1 -0
  258. package/package/components/flows/content/FlowResult.svelte +2 -3
  259. package/package/components/flows/content/FlowResult.svelte.d.ts +2 -4
  260. package/package/components/flows/content/FlowWhileLoop.svelte +1 -1
  261. package/package/components/flows/dfs.d.ts +3 -1
  262. package/package/components/flows/dfs.js +5 -1
  263. package/package/components/flows/flowInfers.js +78 -0
  264. package/package/components/flows/flowState.d.ts +2 -3
  265. package/package/components/flows/flowState.js +2 -2
  266. package/package/components/flows/flowStateUtils.svelte.d.ts +4 -4
  267. package/package/components/flows/flowStateUtils.svelte.js +14 -13
  268. package/package/components/flows/flowStore.d.ts +3 -4
  269. package/package/components/flows/header/FlowPreviewButtons.svelte +2 -1
  270. package/package/components/flows/header/FlowYamlEditor.svelte +10 -1
  271. package/package/components/flows/idUtils.js +2 -1
  272. package/package/components/flows/map/FlowGraphPreviewButton.svelte +1 -1
  273. package/package/components/flows/map/FlowJobsMenu.svelte +7 -3
  274. package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +1 -0
  275. package/package/components/flows/map/FlowModuleSchemaItem.svelte +15 -15
  276. package/package/components/flows/map/FlowModuleSchemaMap.svelte +27 -15
  277. package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +6 -4
  278. package/package/components/flows/map/InsertModuleButton.svelte +4 -1
  279. package/package/components/flows/map/InsertModuleInner.svelte +9 -1
  280. package/package/components/flows/map/InsertModuleInner.svelte.d.ts +1 -0
  281. package/package/components/flows/map/MapItem.svelte +4 -2
  282. package/package/components/flows/pickers/TopLevelNode.svelte +4 -1
  283. package/package/components/flows/propPicker/InputPickerInner.svelte +5 -4
  284. package/package/components/flows/propPicker/OutputBadge.svelte +16 -10
  285. package/package/components/flows/propPicker/OutputPickerInner.svelte +19 -6
  286. package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +6 -2
  287. package/package/components/flows/propPicker/StepHistory.svelte +4 -1
  288. package/package/components/flows/testSteps.svelte.d.ts +3 -2
  289. package/package/components/flows/testSteps.svelte.js +26 -23
  290. package/package/components/flows/types.d.ts +1 -1
  291. package/package/components/flows/utils.d.ts +3 -5
  292. package/package/components/flows/utils.js +3 -4
  293. package/package/components/git_sync/DetectionFlow.svelte +202 -0
  294. package/package/components/git_sync/DetectionFlow.svelte.d.ts +6 -0
  295. package/package/components/git_sync/GitSyncContext.svelte.d.ts +82 -0
  296. package/package/components/git_sync/GitSyncContext.svelte.js +462 -0
  297. package/package/components/git_sync/GitSyncModalManager.svelte +99 -0
  298. package/package/components/git_sync/GitSyncModalManager.svelte.d.ts +18 -0
  299. package/package/components/git_sync/GitSyncRepositoryCard.svelte +339 -0
  300. package/package/components/git_sync/GitSyncRepositoryCard.svelte.d.ts +6 -0
  301. package/package/components/git_sync/GitSyncRepositoryList.svelte +17 -0
  302. package/package/components/git_sync/GitSyncRepositoryList.svelte.d.ts +18 -0
  303. package/package/components/git_sync/GitSyncSection.svelte +89 -0
  304. package/package/components/git_sync/GitSyncSection.svelte.d.ts +3 -0
  305. package/package/components/git_sync/GitSyncSuccessModal.svelte +58 -0
  306. package/package/components/git_sync/GitSyncSuccessModal.svelte.d.ts +7 -0
  307. package/package/components/git_sync/PullWorkspaceModal.svelte +575 -0
  308. package/package/components/git_sync/PullWorkspaceModal.svelte.d.ts +15 -0
  309. package/package/components/git_sync/PushWorkspaceModal.svelte +320 -0
  310. package/package/components/git_sync/PushWorkspaceModal.svelte.d.ts +12 -0
  311. package/package/components/graph/FlowGraphV2.svelte +49 -25
  312. package/package/components/graph/FlowGraphV2.svelte.d.ts +5 -2
  313. package/package/components/graph/graphBuilder.svelte.d.ts +49 -17
  314. package/package/components/graph/graphBuilder.svelte.js +31 -15
  315. package/package/components/graph/model.d.ts +9 -6
  316. package/package/components/graph/renderers/edges/BaseEdge.svelte +3 -3
  317. package/package/components/graph/renderers/edges/BaseEdge.svelte.d.ts +2 -3
  318. package/package/components/graph/renderers/nodes/AIToolNode.svelte +234 -0
  319. package/package/components/graph/renderers/nodes/AIToolNode.svelte.d.ts +24 -0
  320. package/package/components/graph/renderers/nodes/AssetNode.svelte +19 -14
  321. package/package/components/graph/renderers/nodes/AssetNode.svelte.d.ts +18 -1
  322. package/package/components/graph/renderers/nodes/BranchAllEndNode.svelte +1 -1
  323. package/package/components/graph/renderers/nodes/BranchAllStart.svelte +1 -1
  324. package/package/components/graph/renderers/nodes/BranchOneStart.svelte +1 -1
  325. package/package/components/graph/renderers/nodes/ForLoopEndNode.svelte +2 -2
  326. package/package/components/graph/renderers/nodes/ForLoopStartNode.svelte +1 -1
  327. package/package/components/graph/renderers/nodes/ModuleNode.svelte +21 -21
  328. package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +64 -0
  329. package/package/components/graph/renderers/nodes/NewAIToolNode.svelte.d.ts +7 -0
  330. package/package/components/graph/renderers/nodes/branchOneEndNode.svelte +1 -1
  331. package/package/components/icons/AssetDucklakeIcon.svelte +28 -0
  332. package/package/components/icons/AssetDucklakeIcon.svelte.d.ts +9 -0
  333. package/package/components/icons/AssetGenericIcon.svelte +3 -0
  334. package/package/components/icons/DucklakeIcon.svelte +18 -0
  335. package/package/components/icons/DucklakeIcon.svelte.d.ts +6 -0
  336. package/package/components/icons/RubyIcon.svelte +656 -0
  337. package/package/components/icons/RubyIcon.svelte.d.ts +7 -0
  338. package/package/components/instanceSettings.js +20 -3
  339. package/package/components/modulesTest.svelte.d.ts +6 -3
  340. package/package/components/modulesTest.svelte.js +32 -0
  341. package/package/components/preview/FlowPreviewStatus.svelte +3 -1
  342. package/package/components/raw_apps/RawAppEditor.svelte +27 -26
  343. package/package/components/raw_apps/RawAppEditor.svelte.d.ts +17 -17
  344. package/package/components/runs/{JobPreview.svelte → JobRunsPreview.svelte} +2 -5
  345. package/package/components/runs/{JobPreview.svelte.d.ts → JobRunsPreview.svelte.d.ts} +3 -3
  346. package/package/components/runs/NoWorkerWithTagWarning.svelte +3 -3
  347. package/package/components/runs/RunRow.svelte +5 -1
  348. package/package/components/runs/RunsFilter.svelte.d.ts +1 -1
  349. package/package/components/schema/AddProperty.svelte +41 -36
  350. package/package/components/schema/AddProperty.svelte.d.ts +2 -2
  351. package/package/components/schema/AddPropertyV2.svelte +41 -37
  352. package/package/components/schema/AddPropertyV2.svelte.d.ts +1 -1
  353. package/package/components/schema/FlowPropertyEditor.svelte +11 -8
  354. package/package/components/schema/FlowPropertyEditor.svelte.d.ts +1 -1
  355. package/package/components/schema/PropertyEditor.svelte +0 -2
  356. package/package/components/schema/PropertyEditor.svelte.d.ts +1 -1
  357. package/package/components/schema/SchemaFormDND.svelte +2 -1
  358. package/package/components/schema/SchemaFormDND.svelte.d.ts +2 -0
  359. package/package/components/scriptEditor/LogPanel.svelte +5 -3
  360. package/package/components/scriptEditor/LogPanel.svelte.d.ts +5 -1
  361. package/package/components/search/RunsSearch.svelte +1 -1
  362. package/package/components/select/Select.svelte +7 -4
  363. package/package/components/select/Select.svelte.d.ts +5 -0
  364. package/package/components/select/SelectDropdown.svelte +2 -1
  365. package/package/components/select/SelectDropdown.svelte.d.ts +3 -0
  366. package/package/components/settings/CreateToken.svelte +132 -12
  367. package/package/components/settings/CreateToken.svelte.d.ts +3 -20
  368. package/package/components/settings/TokenDisplay.svelte +18 -42
  369. package/package/components/settings/TokenDisplay.svelte.d.ts +0 -1
  370. package/package/components/settings/TokensTable.svelte +2 -4
  371. package/package/components/settings/TokensTable.svelte.d.ts +3 -19
  372. package/package/components/settings/WorkspaceUserSettings.svelte +428 -69
  373. package/package/components/sidebar/MenuButton.svelte +12 -10
  374. package/package/components/sidebar/changelogs.js +5 -0
  375. package/package/components/stepHistoryLoader.svelte.d.ts +2 -2
  376. package/package/components/stepHistoryLoader.svelte.js +7 -12
  377. package/package/components/table/AutoDataTable.svelte +6 -4
  378. package/package/components/table/AutoDataTable.svelte.d.ts +1 -0
  379. package/package/components/table/DataTable.svelte +12 -10
  380. package/package/components/table/DataTable.svelte.d.ts +1 -0
  381. package/package/components/triggers/TriggerRetriesAndErrorHandler.svelte.d.ts +2 -2
  382. package/package/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte +1 -1
  383. package/package/components/triggers/gcp/GcpTriggerEditorConfigSection.svelte.d.ts +2 -1
  384. package/package/components/triggers/gcp/GcpTriggerEditorInner.svelte +50 -11
  385. package/package/components/triggers/gcp/utils.js +1 -0
  386. package/package/components/triggers/http/OpenAPISpecGenerator.svelte +2 -2
  387. package/package/components/triggers/http/utils.js +1 -1
  388. package/package/components/triggers/kafka/utils.js +1 -1
  389. package/package/components/triggers/mqtt/utils.js +1 -1
  390. package/package/components/triggers/nats/utils.js +1 -1
  391. package/package/components/triggers/postgres/utils.js +1 -1
  392. package/package/components/triggers/sqs/utils.js +1 -1
  393. package/package/components/triggers/utils.js +2 -1
  394. package/package/components/triggers/webhook/WebhooksConfigSection.svelte +24 -26
  395. package/package/components/triggers/webhook/WebhooksPanel.svelte +1 -15
  396. package/package/components/triggers/websocket/utils.js +1 -1
  397. package/package/components/tutorials/FlowBuilderTutorialBranchOne.svelte +1 -1
  398. package/package/components/tutorials/FlowBuilderTutorialForLoop.svelte +4 -4
  399. package/package/components/tutorials/utils.js +3 -0
  400. package/package/components/worker_group.d.ts +4 -1
  401. package/package/components/worker_group.js +3 -2
  402. package/package/components/workspaceSettings/AISettings.svelte +52 -36
  403. package/package/components/workspaceSettings/DucklakeSettings.svelte +321 -0
  404. package/package/components/workspaceSettings/DucklakeSettings.svelte.d.ts +23 -0
  405. package/package/components/workspaceSettings/GitSyncFilterSettings.svelte +122 -499
  406. package/package/components/workspaceSettings/GitSyncFilterSettings.svelte.d.ts +8 -10
  407. package/package/consts.js +2 -1
  408. package/package/editorLangUtils.d.ts +1 -1
  409. package/package/editorLangUtils.js +2 -0
  410. package/package/editorUtils.d.ts +2 -1
  411. package/package/editorUtils.js +2 -1
  412. package/package/gen/core/OpenAPI.js +1 -1
  413. package/package/gen/schemas.gen.d.ts +303 -14
  414. package/package/gen/schemas.gen.js +371 -76
  415. package/package/gen/services.gen.d.ts +136 -16
  416. package/package/gen/services.gen.js +264 -19
  417. package/package/gen/types.gen.d.ts +736 -17
  418. package/package/git-sync.d.ts +36 -0
  419. package/package/git-sync.js +1 -0
  420. package/package/hub.d.ts +1 -0
  421. package/package/hubPaths.json +9 -3
  422. package/package/infer.js +13 -3
  423. package/package/monaco_workers/graphql.worker.bundle.js +144 -110
  424. package/package/script_helpers.d.ts +5 -2
  425. package/package/script_helpers.js +87 -14
  426. package/package/scripts.d.ts +1 -1
  427. package/package/scripts.js +3 -2
  428. package/package/services/JobManager.d.ts +28 -0
  429. package/package/services/JobManager.js +114 -0
  430. package/package/stores.d.ts +3 -1
  431. package/package/stores.js +2 -0
  432. package/package/svelte5Utils.svelte.d.ts +16 -0
  433. package/package/svelte5Utils.svelte.js +26 -0
  434. package/package/utils.d.ts +19 -2
  435. package/package/utils.js +55 -2
  436. package/package.json +24 -22
  437. package/package/components/AllFlowLogs.svelte +0 -31
  438. package/package/components/AllFlowLogs.svelte.d.ts +0 -8
  439. package/package/components/InitGitRepoPopover.svelte +0 -410
  440. package/package/components/InitGitRepoPopover.svelte.d.ts +0 -13
  441. package/package/components/PullGitRepoPopover.svelte +0 -355
  442. package/package/components/PullGitRepoPopover.svelte.d.ts +0 -18
  443. package/package/components/copilot/chat/navigator/apiTools.d.ts +0 -68
  444. package/package/components/copilot/chat/navigator/apiTools.js +0 -258
  445. package/package/inferArgSig.d.ts +0 -42
  446. package/package/inferArgSig.js +0 -198
@@ -1,10 +1,10 @@
1
- import { ScriptService } from '../../../../gen';
1
+ import { ScriptService, JobService } from '../../../../gen';
2
2
  import YAML from 'yaml';
3
3
  import { z } from 'zod';
4
4
  import uFuzzy from '@leeoniya/ufuzzy';
5
5
  import { emptySchema, emptyString } from '../../../../utils';
6
6
  import { getFormattedResourceTypes, getLangContext, SUPPORTED_CHAT_SCRIPT_LANGUAGES } from '../script/core';
7
- import { createSearchHubScriptsTool, createToolDef } from '../shared';
7
+ import { createSearchHubScriptsTool, createToolDef, executeTestRun, buildSchemaForTool, buildTestRunArgs } from '../shared';
8
8
  const searchScriptsSchema = z.object({
9
9
  query: z
10
10
  .string()
@@ -186,20 +186,39 @@ const getInstructionsForCodeGenerationToolSchema = z.object({
186
186
  language: langSchema.describe('The programming language the code will be written in')
187
187
  });
188
188
  const getInstructionsForCodeGenerationToolDef = createToolDef(getInstructionsForCodeGenerationToolSchema, 'get_instructions_for_code_generation', 'Get instructions for code generation for a raw script step');
189
+ // Will be overridden by setSchema
190
+ const testRunFlowSchema = z.object({
191
+ args: z.object({}).nullable().optional()
192
+ .describe('Arguments to pass to the flow (optional, uses default flow inputs if not provided)')
193
+ });
194
+ const testRunFlowToolDef = createToolDef(testRunFlowSchema, 'test_run_flow', 'Execute a test run of the current flow');
195
+ const testRunStepSchema = z.object({
196
+ stepId: z.string().describe('The id of the step to test'),
197
+ args: z
198
+ .object({})
199
+ .nullable()
200
+ .optional()
201
+ .describe('Arguments to pass to the step (optional, uses default step inputs if not provided)')
202
+ });
203
+ const testRunStepToolDef = createToolDef(testRunStepSchema, 'test_run_step', 'Execute a test run of a specific step in the flow');
189
204
  const workspaceScriptsSearch = new WorkspaceScriptsSearch();
190
205
  export const flowTools = [
191
206
  createSearchHubScriptsTool(false),
192
207
  {
193
208
  def: searchScriptsToolDef,
194
209
  fn: async ({ args, workspace, toolId, toolCallbacks }) => {
195
- toolCallbacks.setToolStatus(toolId, 'Searching for workspace scripts related to "' + args.query + '"...');
210
+ toolCallbacks.setToolStatus(toolId, {
211
+ content: 'Searching for workspace scripts related to "' + args.query + '"...'
212
+ });
196
213
  const parsedArgs = searchScriptsSchema.parse(args);
197
214
  const scriptResults = await workspaceScriptsSearch.search(parsedArgs.query, workspace);
198
- toolCallbacks.setToolStatus(toolId, 'Found ' +
199
- scriptResults.length +
200
- ' scripts in the workspace related to "' +
201
- args.query +
202
- '"');
215
+ toolCallbacks.setToolStatus(toolId, {
216
+ content: 'Found ' +
217
+ scriptResults.length +
218
+ ' scripts in the workspace related to "' +
219
+ args.query +
220
+ '"'
221
+ });
203
222
  return JSON.stringify(scriptResults);
204
223
  }
205
224
  },
@@ -207,74 +226,76 @@ export const flowTools = [
207
226
  def: addStepToolDef,
208
227
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
209
228
  const parsedArgs = addStepSchema.parse(args);
210
- toolCallbacks.setToolStatus(toolId, parsedArgs.location.type === 'after'
211
- ? `Adding a step after step '${parsedArgs.location.afterId}'`
212
- : parsedArgs.location.type === 'start'
213
- ? 'Adding a step at the start'
214
- : parsedArgs.location.type === 'start_inside_forloop'
215
- ? `Adding a step at the start of the forloop step '${parsedArgs.location.inside}'`
216
- : parsedArgs.location.type === 'start_inside_branch'
217
- ? `Adding a step at the start of the branch ${parsedArgs.location.branchIndex + 1} of step '${parsedArgs.location.inside}'`
218
- : parsedArgs.location.type === 'preprocessor'
219
- ? 'Adding a preprocessor step'
220
- : parsedArgs.location.type === 'failure'
221
- ? 'Adding a failure step'
222
- : 'Adding a step');
229
+ toolCallbacks.setToolStatus(toolId, {
230
+ content: parsedArgs.location.type === 'after'
231
+ ? `Adding a step after step '${parsedArgs.location.afterId}'`
232
+ : parsedArgs.location.type === 'start'
233
+ ? 'Adding a step at the start'
234
+ : parsedArgs.location.type === 'start_inside_forloop'
235
+ ? `Adding a step at the start of the forloop step '${parsedArgs.location.inside}'`
236
+ : parsedArgs.location.type === 'start_inside_branch'
237
+ ? `Adding a step at the start of the branch ${parsedArgs.location.branchIndex + 1} of step '${parsedArgs.location.inside}'`
238
+ : parsedArgs.location.type === 'preprocessor'
239
+ ? 'Adding a preprocessor step'
240
+ : parsedArgs.location.type === 'failure'
241
+ ? 'Adding a failure step'
242
+ : 'Adding a step'
243
+ });
223
244
  const id = await helpers.insertStep(parsedArgs.location, parsedArgs.step);
224
245
  helpers.selectStep(id);
225
- toolCallbacks.setToolStatus(toolId, `Added step '${id}'`);
246
+ toolCallbacks.setToolStatus(toolId, { content: `Added step '${id}'` });
226
247
  return `Step ${id} added. Here is the updated flow, make sure to take it into account when adding another step:\n${YAML.stringify(helpers.getModules())}`;
227
248
  }
228
249
  },
229
250
  {
230
251
  def: removeStepToolDef,
231
252
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
232
- toolCallbacks.setToolStatus(toolId, `Removing step ${args.id}...`);
253
+ toolCallbacks.setToolStatus(toolId, { content: `Removing step ${args.id}...` });
233
254
  const parsedArgs = removeStepSchema.parse(args);
234
255
  helpers.removeStep(parsedArgs.id);
235
- toolCallbacks.setToolStatus(toolId, `Removed step '${parsedArgs.id}'`);
256
+ toolCallbacks.setToolStatus(toolId, { content: `Removed step '${parsedArgs.id}'` });
236
257
  return `Step '${parsedArgs.id}' removed. Here is the updated flow:\n${YAML.stringify(helpers.getModules())}`;
237
258
  }
238
259
  },
239
260
  {
240
261
  def: getStepInputsToolDef,
241
262
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
242
- toolCallbacks.setToolStatus(toolId, `Getting step ${args.id} inputs...`);
263
+ toolCallbacks.setToolStatus(toolId, { content: `Getting step ${args.id} inputs...` });
243
264
  const parsedArgs = getStepInputsSchema.parse(args);
244
265
  const inputs = await helpers.getStepInputs(parsedArgs.id);
245
- toolCallbacks.setToolStatus(toolId, `Retrieved step '${parsedArgs.id}' inputs`);
266
+ toolCallbacks.setToolStatus(toolId, { content: `Retrieved step '${parsedArgs.id}' inputs` });
246
267
  return YAML.stringify(inputs);
247
268
  }
248
269
  },
249
270
  {
250
271
  def: setStepInputsToolDef,
251
272
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
252
- toolCallbacks.setToolStatus(toolId, `Setting step ${args.id} inputs...`);
273
+ toolCallbacks.setToolStatus(toolId, { content: `Setting step ${args.id} inputs...` });
253
274
  const parsedArgs = setStepInputsSchema.parse(args);
254
275
  await helpers.setStepInputs(parsedArgs.id, parsedArgs.inputs);
255
276
  helpers.selectStep(parsedArgs.id);
256
277
  const inputs = await helpers.getStepInputs(parsedArgs.id);
257
- toolCallbacks.setToolStatus(toolId, `Set step '${parsedArgs.id}' inputs`);
278
+ toolCallbacks.setToolStatus(toolId, { content: `Set step '${parsedArgs.id}' inputs` });
258
279
  return `Step '${parsedArgs.id}' inputs set. New inputs:\n${YAML.stringify(inputs)}`;
259
280
  },
260
281
  preAction: ({ toolCallbacks, toolId }) => {
261
- toolCallbacks.setToolStatus(toolId, 'Setting step inputs...');
282
+ toolCallbacks.setToolStatus(toolId, { content: 'Setting step inputs...' });
262
283
  }
263
284
  },
264
285
  {
265
286
  def: setFlowInputsSchemaToolDef,
266
287
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
267
- toolCallbacks.setToolStatus(toolId, 'Setting flow inputs schema...');
288
+ toolCallbacks.setToolStatus(toolId, { content: 'Setting flow inputs schema...' });
268
289
  const parsedArgs = setFlowInputsSchemaSchema.parse(args);
269
290
  const schema = JSON.parse(parsedArgs.schema);
270
291
  await helpers.setFlowInputsSchema(schema);
271
292
  helpers.selectStep('Input');
272
293
  const updatedSchema = await helpers.getFlowInputsSchema();
273
- toolCallbacks.setToolStatus(toolId, 'Set flow inputs schema');
294
+ toolCallbacks.setToolStatus(toolId, { content: 'Set flow inputs schema' });
274
295
  return `Flow inputs schema set. New schema:\n${JSON.stringify(updatedSchema)}`;
275
296
  },
276
297
  preAction: ({ toolCallbacks, toolId }) => {
277
- toolCallbacks.setToolStatus(toolId, 'Setting flow inputs schema...');
298
+ toolCallbacks.setToolStatus(toolId, { content: 'Setting flow inputs schema...' });
278
299
  }
279
300
  },
280
301
  {
@@ -285,7 +306,9 @@ export const flowTools = [
285
306
  allowResourcesFetch: true,
286
307
  isPreprocessor: parsedArgs.id === 'preprocessor'
287
308
  });
288
- toolCallbacks.setToolStatus(toolId, 'Retrieved instructions for code generation in ' + parsedArgs.language);
309
+ toolCallbacks.setToolStatus(toolId, {
310
+ content: 'Retrieved instructions for code generation in ' + parsedArgs.language
311
+ });
289
312
  return langContext;
290
313
  }
291
314
  },
@@ -293,14 +316,16 @@ export const flowTools = [
293
316
  def: setCodeToolDef,
294
317
  fn: async ({ args, helpers, toolId, toolCallbacks }) => {
295
318
  const parsedArgs = setCodeSchema.parse(args);
296
- toolCallbacks.setToolStatus(toolId, `Setting code for step '${parsedArgs.id}'...`);
319
+ toolCallbacks.setToolStatus(toolId, {
320
+ content: `Setting code for step '${parsedArgs.id}'...`
321
+ });
297
322
  await helpers.setCode(parsedArgs.id, parsedArgs.code);
298
323
  helpers.selectStep(parsedArgs.id);
299
- toolCallbacks.setToolStatus(toolId, `Set code for step '${parsedArgs.id}'`);
324
+ toolCallbacks.setToolStatus(toolId, { content: `Set code for step '${parsedArgs.id}'` });
300
325
  return `Step code set`;
301
326
  },
302
327
  preAction: ({ toolCallbacks, toolId }) => {
303
- toolCallbacks.setToolStatus(toolId, 'Setting code for step...');
328
+ toolCallbacks.setToolStatus(toolId, { content: 'Setting code for step...' });
304
329
  }
305
330
  },
306
331
  {
@@ -309,7 +334,9 @@ export const flowTools = [
309
334
  const parsedArgs = setBranchPredicateSchema.parse(args);
310
335
  await helpers.setBranchPredicate(parsedArgs.id, parsedArgs.branchIndex, parsedArgs.expression);
311
336
  helpers.selectStep(parsedArgs.id);
312
- toolCallbacks.setToolStatus(toolId, `Set predicate of branch ${parsedArgs.branchIndex + 1} of '${parsedArgs.id}'`);
337
+ toolCallbacks.setToolStatus(toolId, {
338
+ content: `Set predicate of branch ${parsedArgs.branchIndex + 1} of '${parsedArgs.id}'`
339
+ });
313
340
  return `Branch ${parsedArgs.branchIndex} of '${parsedArgs.id}' predicate set`;
314
341
  }
315
342
  },
@@ -319,7 +346,7 @@ export const flowTools = [
319
346
  const parsedArgs = addBranchSchema.parse(args);
320
347
  await helpers.addBranch(parsedArgs.id);
321
348
  helpers.selectStep(parsedArgs.id);
322
- toolCallbacks.setToolStatus(toolId, `Added branch to '${parsedArgs.id}'`);
349
+ toolCallbacks.setToolStatus(toolId, { content: `Added branch to '${parsedArgs.id}'` });
323
350
  return `Branch added to '${parsedArgs.id}'`;
324
351
  }
325
352
  },
@@ -329,7 +356,9 @@ export const flowTools = [
329
356
  const parsedArgs = removeBranchSchema.parse(args);
330
357
  await helpers.removeBranch(parsedArgs.id, parsedArgs.branchIndex);
331
358
  helpers.selectStep(parsedArgs.id);
332
- toolCallbacks.setToolStatus(toolId, `Removed branch ${parsedArgs.branchIndex + 1} of '${parsedArgs.id}'`);
359
+ toolCallbacks.setToolStatus(toolId, {
360
+ content: `Removed branch ${parsedArgs.branchIndex + 1} of '${parsedArgs.id}'`
361
+ });
333
362
  return `Branch ${parsedArgs.branchIndex} of '${parsedArgs.id}' removed`;
334
363
  }
335
364
  },
@@ -339,7 +368,9 @@ export const flowTools = [
339
368
  const parsedArgs = setForLoopIteratorExpressionSchema.parse(args);
340
369
  await helpers.setForLoopIteratorExpression(parsedArgs.id, parsedArgs.expression);
341
370
  helpers.selectStep(parsedArgs.id);
342
- toolCallbacks.setToolStatus(toolId, `Set forloop '${parsedArgs.id}' iterator expression`);
371
+ toolCallbacks.setToolStatus(toolId, {
372
+ content: `Set forloop '${parsedArgs.id}' iterator expression`
373
+ });
343
374
  return `Forloop '${parsedArgs.id}' iterator expression set`;
344
375
  }
345
376
  },
@@ -347,11 +378,150 @@ export const flowTools = [
347
378
  def: resourceTypeToolDef,
348
379
  fn: async ({ args, toolId, workspace, toolCallbacks }) => {
349
380
  const parsedArgs = resourceTypeToolSchema.parse(args);
350
- toolCallbacks.setToolStatus(toolId, 'Searching resource types for "' + parsedArgs.query + '"...');
381
+ toolCallbacks.setToolStatus(toolId, {
382
+ content: 'Searching resource types for "' + parsedArgs.query + '"...'
383
+ });
351
384
  const formattedResourceTypes = await getFormattedResourceTypes(parsedArgs.language, parsedArgs.query, workspace);
352
- toolCallbacks.setToolStatus(toolId, 'Retrieved resource types for "' + parsedArgs.query + '"');
385
+ toolCallbacks.setToolStatus(toolId, {
386
+ content: 'Retrieved resource types for "' + parsedArgs.query + '"'
387
+ });
353
388
  return formattedResourceTypes;
354
389
  }
390
+ },
391
+ {
392
+ def: testRunFlowToolDef,
393
+ fn: async function ({ args, workspace, helpers, toolCallbacks, toolId }) {
394
+ const { flow } = helpers.getFlowAndSelectedId();
395
+ if (!flow || !flow.value) {
396
+ toolCallbacks.setToolStatus(toolId, {
397
+ content: 'No flow available to test',
398
+ error: 'No flow found in current context'
399
+ });
400
+ throw new Error('No flow available to test. Please ensure you have a flow open in the editor.');
401
+ }
402
+ const parsedArgs = await buildTestRunArgs(args, this.def);
403
+ return executeTestRun({
404
+ jobStarter: () => JobService.runFlowPreview({
405
+ workspace: workspace,
406
+ requestBody: {
407
+ args: parsedArgs,
408
+ value: flow.value,
409
+ }
410
+ }),
411
+ workspace,
412
+ toolCallbacks,
413
+ toolId,
414
+ startMessage: 'Starting flow test run...',
415
+ contextName: 'flow'
416
+ });
417
+ },
418
+ setSchema: async function (helpers) {
419
+ await buildSchemaForTool(this.def, async () => {
420
+ const flowInputsSchema = await helpers.getFlowInputsSchema();
421
+ return flowInputsSchema;
422
+ });
423
+ },
424
+ requiresConfirmation: true,
425
+ confirmationMessage: 'Run flow test',
426
+ showDetails: true
427
+ },
428
+ {
429
+ // set strict to false to avoid issues with open ai models
430
+ def: { ...testRunStepToolDef, function: { ...testRunStepToolDef.function, strict: false } },
431
+ fn: async ({ args, workspace, helpers, toolCallbacks, toolId }) => {
432
+ const { flow } = helpers.getFlowAndSelectedId();
433
+ if (!flow || !flow.value) {
434
+ toolCallbacks.setToolStatus(toolId, {
435
+ content: 'No flow available to test step from',
436
+ error: 'No flow found in current context'
437
+ });
438
+ throw new Error('No flow available to test step from. Please ensure you have a flow open in the editor.');
439
+ }
440
+ const stepId = args.stepId;
441
+ const stepArgs = args.args || {};
442
+ // Find the step in the flow
443
+ const modules = helpers.getModules();
444
+ let targetModule = modules.find((m) => m.id === stepId);
445
+ if (!targetModule) {
446
+ toolCallbacks.setToolStatus(toolId, {
447
+ content: `Step '${stepId}' not found in flow`,
448
+ error: `Step with id '${stepId}' does not exist in the current flow`
449
+ });
450
+ throw new Error(`Step with id '${stepId}' not found in flow. Available steps: ${modules.map((m) => m.id).join(', ')}`);
451
+ }
452
+ const module = targetModule;
453
+ const moduleValue = module.value;
454
+ if (moduleValue.type === 'rawscript') {
455
+ // Test raw script step
456
+ return executeTestRun({
457
+ jobStarter: () => JobService.runScriptPreview({
458
+ workspace: workspace,
459
+ requestBody: {
460
+ content: moduleValue.content ?? '',
461
+ language: moduleValue.language,
462
+ args: module.id === 'preprocessor' ? { _ENTRYPOINT_OVERRIDE: 'preprocessor', ...stepArgs } : stepArgs
463
+ }
464
+ }),
465
+ workspace,
466
+ toolCallbacks,
467
+ toolId,
468
+ startMessage: `Starting test run of step '${stepId}'...`,
469
+ contextName: 'script'
470
+ });
471
+ }
472
+ else if (moduleValue.type === 'script') {
473
+ // Test script step - need to get the script content
474
+ const script = moduleValue.hash
475
+ ? await ScriptService.getScriptByHash({
476
+ workspace: workspace,
477
+ hash: moduleValue.hash
478
+ })
479
+ : await ScriptService.getScriptByPath({
480
+ workspace: workspace,
481
+ path: moduleValue.path
482
+ });
483
+ return executeTestRun({
484
+ jobStarter: () => JobService.runScriptPreview({
485
+ workspace: workspace,
486
+ requestBody: {
487
+ content: script.content,
488
+ language: script.language,
489
+ args: module.id === 'preprocessor' ? { _ENTRYPOINT_OVERRIDE: 'preprocessor', ...stepArgs } : stepArgs,
490
+ }
491
+ }),
492
+ workspace,
493
+ toolCallbacks,
494
+ toolId,
495
+ startMessage: `Starting test run of script step '${stepId}'...`,
496
+ contextName: 'script'
497
+ });
498
+ }
499
+ else if (moduleValue.type === 'flow') {
500
+ // Test flow step
501
+ return executeTestRun({
502
+ jobStarter: () => JobService.runFlowByPath({
503
+ workspace: workspace,
504
+ path: moduleValue.path,
505
+ requestBody: stepArgs
506
+ }),
507
+ workspace,
508
+ toolCallbacks,
509
+ toolId,
510
+ startMessage: `Starting test run of flow step '${stepId}'...`,
511
+ contextName: 'flow'
512
+ });
513
+ }
514
+ else {
515
+ toolCallbacks.setToolStatus(toolId, {
516
+ content: `Step type '${moduleValue.type}' not supported for testing`,
517
+ error: `Cannot test step of type '${moduleValue.type}'`
518
+ });
519
+ throw new Error(`Cannot test step of type '${moduleValue.type}'. Supported types: rawscript, script, flow`);
520
+ }
521
+ },
522
+ requiresConfirmation: true,
523
+ confirmationMessage: 'Run flow step test',
524
+ showDetails: true
355
525
  }
356
526
  ];
357
527
  export function prepareFlowSystemMessage() {
@@ -359,6 +529,7 @@ export function prepareFlowSystemMessage() {
359
529
  Follow the user instructions carefully.
360
530
  Go step by step, and explain what you're doing as you're doing it.
361
531
  DO NOT wait for user confirmation before performing an action. Only do it if the user explicitly asks you to wait in their initial instructions.
532
+ ALWAYS test your modifications. You have access to the \`test_run_flow\` and \`test_run_step\` tools to test the flow and steps. If you only modified a single step, use the \`test_run_step\` tool to test it. If you modified the flow, use the \`test_run_flow\` tool to test it. If the user cancels the test run, do not try again and wait for the next user instruction.
362
533
 
363
534
  ## Understanding User Requests
364
535
 
@@ -54,6 +54,9 @@ export function getNestedModules(flow, id, branchIndex) {
54
54
  }
55
55
  return branch.modules;
56
56
  }
57
+ else if (module.value.type === 'aiagent') {
58
+ return module.value.tools;
59
+ }
57
60
  else {
58
61
  throw new Error('Module is not a loop or branch');
59
62
  }
@@ -27,6 +27,6 @@ export declare class AIChatEditorHandler {
27
27
  groupIndex: number;
28
28
  }): void;
29
29
  private calculateVisualChanges;
30
- reviewAndApply(newCode: string): Promise<void>;
30
+ reviewAndApply(newCode: string, applyAll?: boolean): Promise<void>;
31
31
  }
32
32
  export {};
@@ -147,7 +147,7 @@ export class AIChatEditorHandler {
147
147
  }
148
148
  return changedLines;
149
149
  }
150
- async reviewAndApply(newCode) {
150
+ async reviewAndApply(newCode, applyAll = false) {
151
151
  if (aiChatManager.pendingNewCode === newCode) {
152
152
  this.acceptAll();
153
153
  return;
@@ -204,9 +204,15 @@ export class AIChatEditorHandler {
204
204
  return c;
205
205
  }
206
206
  });
207
- ({ collection, ids } = await displayVisualChanges('editor-windmill-chat-style', this.editor, changes));
208
- this.decorationsCollections.push(collection);
209
- this.viewZoneIds.push(...ids);
207
+ if (!applyAll) {
208
+ ;
209
+ ({ collection, ids } = await displayVisualChanges('editor-windmill-chat-style', this.editor, changes));
210
+ this.decorationsCollections.push(collection);
211
+ this.viewZoneIds.push(...ids);
212
+ }
213
+ }
214
+ if (applyAll) {
215
+ this.acceptAll();
210
216
  }
211
217
  }
212
218
  }
@@ -1,6 +1,6 @@
1
1
  import type { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam } from 'openai/resources/index.mjs';
2
2
  import type { Tool } from '../shared';
3
- export declare const CHAT_SYSTEM_PROMPT: string;
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";
4
4
  export declare const getDocumentationTool: Tool<{}>;
5
5
  export declare const navigatorTools: Tool<{}>[];
6
6
  export declare function prepareNavigatorSystemMessage(): ChatCompletionSystemMessageParam;
@@ -1,5 +1,5 @@
1
1
  import { ResourceService } from '../../../../gen';
2
- import { enterpriseLicense, workspaceStore } from '../../../../stores';
2
+ import { workspaceStore } from '../../../../stores';
3
3
  import { get } from 'svelte/store';
4
4
  import { triggerablesByAi } from '../sharedChatState.svelte';
5
5
  export const CHAT_SYSTEM_PROMPT = `
@@ -10,7 +10,7 @@ You have access to these tools:
10
10
  1. View current buttons and inputs on the page (get_triggerable_components)
11
11
  2. Execute buttons and inputs (trigger_component)
12
12
  3. Get documentation for user requests (get_documentation)
13
- 4. A list of tools to interact with the backend API
13
+ 4. Change the AI mode to the one specified (change_mode)
14
14
 
15
15
  INSTRUCTIONS:
16
16
  - 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.
@@ -22,7 +22,7 @@ INSTRUCTIONS:
22
22
  - 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.
23
23
  - 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.
24
24
  - 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.
25
- ${get(enterpriseLicense) ? `- If asked to look through the jobs logs, use the /srch/w/{workspace}/index/search/job endpoint to search for the relevant jobs runs. Then use /w/{workspace}/jobs_u/get to get the logs of each job.` : ''}
25
+ - 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.
26
26
 
27
27
  GENERAL PRINCIPLES:
28
28
  - Be concise but thorough
@@ -33,7 +33,6 @@ GENERAL PRINCIPLES:
33
33
  - 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.
34
34
 
35
35
  IMPORTANT CONSIDERATIONS:
36
- - If you do an API call, make sure you ask the user if he also wants you to navigate the application to fulfill his request.
37
36
  - 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.
38
37
  - If you navigate to a script creation page, consider this:
39
38
  - The page opens with the settings drawer open. After doing the changes mentioned by the user, close the settings drawer.
@@ -41,13 +40,6 @@ IMPORTANT CONSIDERATIONS:
41
40
  - If you navigate to a flow creation page, consider this:
42
41
  - 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.
43
42
 
44
- API_TOOLS_RESTRICTIONS:
45
- - You can only use the API tools to fetch data from the backend API after you tried to navigate the application to fulfill the user's request and it's not enough to do so. ALWAYS ask the user if he also wants you to navigate the application to fulfill his request.
46
- - If you use api tools, also fetch the relevant documentation to help the user understand the data you fetched, with a link to the documentation if possible.
47
-
48
- RETRIEVE_AVAILABLE_RESOURCES_RESTRICTION:
49
- - You can only use the get_available_resources tool to fill a form or an input based on the user's request. Do not use it when directly asked to fetch available resources, use the API tools instead.
50
-
51
43
  Always use the provided tools purposefully and appropriately to achieve the user's goals.
52
44
  Your actions only allow you to navigate the application through the provided tools.
53
45
  When 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.
@@ -259,18 +251,24 @@ async function getAvailableResources(args) {
259
251
  const triggerComponentTool = {
260
252
  def: EXECUTE_COMMAND_TOOL,
261
253
  fn: async ({ args, toolId, toolCallbacks }) => {
262
- toolCallbacks.setToolStatus(toolId, 'Triggering component...');
254
+ toolCallbacks.setToolStatus(toolId, { content: 'Triggering component...' });
263
255
  const result = triggerComponent(args);
264
- toolCallbacks.setToolStatus(toolId, args.actionTaken.charAt(0).toUpperCase() + args.actionTaken.slice(1));
256
+ toolCallbacks.setToolStatus(toolId, {
257
+ content: args.actionTaken.charAt(0).toUpperCase() + args.actionTaken.slice(1)
258
+ });
265
259
  return result;
266
260
  }
267
261
  };
268
262
  const getTriggerableComponentsTool = {
269
263
  def: GET_TRIGGERABLE_COMPONENTS_TOOL,
270
264
  fn: async ({ toolId, toolCallbacks }) => {
271
- toolCallbacks.setToolStatus(toolId, 'Scanning the page...');
265
+ toolCallbacks.setToolStatus(toolId, {
266
+ content: 'Scanning the page...',
267
+ });
272
268
  const components = getTriggerableComponents();
273
- toolCallbacks.setToolStatus(toolId, 'Scanned the page');
269
+ toolCallbacks.setToolStatus(toolId, {
270
+ content: 'Scanned the page',
271
+ });
274
272
  return components;
275
273
  }
276
274
  };
@@ -278,21 +276,21 @@ const getCurrentPageNameTool = {
278
276
  def: GET_CURRENT_PAGE_NAME_TOOL,
279
277
  fn: async ({ toolId, toolCallbacks }) => {
280
278
  const pageName = getCurrentPageName();
281
- toolCallbacks.setToolStatus(toolId, 'Retrieved current page name');
279
+ toolCallbacks.setToolStatus(toolId, { content: 'Retrieved current page name' });
282
280
  return pageName;
283
281
  }
284
282
  };
285
283
  export const getDocumentationTool = {
286
284
  def: GET_DOCUMENTATION_TOOL,
287
285
  fn: async ({ args, toolId, toolCallbacks }) => {
288
- toolCallbacks.setToolStatus(toolId, 'Getting documentation...');
286
+ toolCallbacks.setToolStatus(toolId, { content: 'Getting documentation...' });
289
287
  try {
290
288
  const docResult = await getDocumentation(args);
291
- toolCallbacks.setToolStatus(toolId, 'Retrieved documentation');
289
+ toolCallbacks.setToolStatus(toolId, { content: 'Retrieved documentation' });
292
290
  return docResult;
293
291
  }
294
292
  catch (error) {
295
- toolCallbacks.setToolStatus(toolId, 'Error getting documentation');
293
+ toolCallbacks.setToolStatus(toolId, { content: 'Error getting documentation', error: 'Error getting documentation' });
296
294
  console.error('Error getting documentation:', error);
297
295
  return 'Failed to get documentation, pursuing with the user request...';
298
296
  }
@@ -301,14 +299,14 @@ export const getDocumentationTool = {
301
299
  const getAvailableResourcesTool = {
302
300
  def: GET_AVAILABLE_RESOURCES_TOOL,
303
301
  fn: async ({ args, toolId, toolCallbacks }) => {
304
- toolCallbacks.setToolStatus(toolId, 'Getting available resources...');
302
+ toolCallbacks.setToolStatus(toolId, { content: 'Getting available resources...' });
305
303
  try {
306
304
  const resources = await getAvailableResources(args);
307
- toolCallbacks.setToolStatus(toolId, 'Retrieved available resources');
305
+ toolCallbacks.setToolStatus(toolId, { content: 'Retrieved available resources' });
308
306
  return resources;
309
307
  }
310
308
  catch (error) {
311
- toolCallbacks.setToolStatus(toolId, 'Error getting available resources');
309
+ toolCallbacks.setToolStatus(toolId, { content: 'Error getting available resources', error: 'Error getting available resources' });
312
310
  console.error('Error getting available resources:', error);
313
311
  return 'Failed to get available resources, pursuing with the user request...';
314
312
  }
@@ -10,7 +10,7 @@ export declare function getLangContext(lang: ScriptLang | 'bunnative' | 'jsx' |
10
10
  isFailure?: boolean;
11
11
  }): string;
12
12
  export declare function getFormattedResourceTypes(lang: ScriptLang | 'bunnative', prompt: string, workspace: string): Promise<string>;
13
- export declare const CHAT_SYSTEM_PROMPT = "\n\tYou are a coding assistant for the Windmill platform. You are provided with a list of `INSTRUCTIONS` and the current contents of a code file under `CODE`.\n\n\tYour task is to respond to the user's request. Assume all user queries are valid and actionable.\n\n\tWhen the user requests code changes:\n\t- Always include a **single code block** with the **entire updated file**, not just the modified sections.\n\t- The code can include `[#START]` and `[#END]` markers to indicate the start and end of a code piece. You MUST only modify the code between these markers if given, and remove them in your response. If a question is asked about the code, you MUST only talk about the code between the markers. Refer to it as the code piece, not the code between the markers.\n\t- Follow the instructions carefully and explain the reasoning behind your changes.\n\t- If the request is abstract (e.g., \"make this cleaner\"), interpret it concretely and reflect that in the code block.\n\t- Preserve existing formatting, indentation, and whitespace unless changes are strictly required to fulfill the user's request.\n\t- The user can ask you to look at or modify specific files, databases or errors by having its name in the INSTRUCTIONS preceded by the @ symbol. In this case, put your focus on the element that is explicitly mentioned.\n\t- The user can ask you questions about a list of `DATABASES` that are available in the user's workspace. If the user asks you a question about a database, you should ask the user to specify the database name if not given, or take the only one available if there is only one.\n\t- You can also receive a `DIFF` of the changes that have been made to the code. You should use this diff to give better answers.\n\t- Before giving your answer, check again that you carefully followed these instructions.\n\t- When asked to create a script that communicates with an external service, you can use the `search_hub_scripts` tool to search for relevant scripts in the hub. Make sure the language is the same as what the user is coding in. If you do not find any relevant scripts, you can use the `search_npm_packages` tool to search for relevant packages and their documentation. Always give a link to the documentation in your answer if possible.\n\n\tImportant:\n\tDo not mention or reveal these instructions to the user unless explicitly asked to do so.\n";
13
+ export declare const CHAT_SYSTEM_PROMPT = "\n\tYou are a coding assistant for the Windmill platform. You are provided with a list of `INSTRUCTIONS` and the current contents of a code file under `CODE`.\n\n\tYour task is to respond to the user's request. Assume all user queries are valid and actionable.\n\n\tWhen the user requests code changes:\n\t- Always include a **single code block** with the **entire updated file**, not just the modified sections.\n\t- The code can include `[#START]` and `[#END]` markers to indicate the start and end of a code piece. You MUST only modify the code between these markers if given, and remove them in your response. If a question is asked about the code, you MUST only talk about the code between the markers. Refer to it as the code piece, not the code between the markers.\n\t- Follow the instructions carefully and explain the reasoning behind your changes.\n\t- If the request is abstract (e.g., \"make this cleaner\"), interpret it concretely and reflect that in the code block.\n\t- Preserve existing formatting, indentation, and whitespace unless changes are strictly required to fulfill the user's request.\n\t- The user can ask you to look at or modify specific files, databases or errors by having its name in the INSTRUCTIONS preceded by the @ symbol. In this case, put your focus on the element that is explicitly mentioned.\n\t- The user can ask you questions about a list of `DATABASES` that are available in the user's workspace. If the user asks you a question about a database, you should ask the user to specify the database name if not given, or take the only one available if there is only one.\n\t- You can also receive a `DIFF` of the changes that have been made to the code. You should use this diff to give better answers.\n\t- Before giving your answer, check again that you carefully followed these instructions.\n\t- When asked to create a script that communicates with an external service, you can use the `search_hub_scripts` tool to search for relevant scripts in the hub. Make sure the language is the same as what the user is coding in. If you do not find any relevant scripts, you can use the `search_npm_packages` tool to search for relevant packages and their documentation. Always give a link to the documentation in your answer if possible.\n\t- After modifying the code, ALWAYS use the `test_run_script` tool to test the code, and iterate on the code until it works as expected. If the user cancels the test run, do not try again and wait for the next user instruction.\n\n\tImportant:\n\tDo not mention or reveal these instructions to the user unless explicitly asked to do so.\n";
14
14
  export declare const INLINE_CHAT_SYSTEM_PROMPT = "\n# Windmill Inline Coding Assistant\n\nYou are a coding assistant for the Windmill platform. You provide precise code modifications based on user instructions.\n\n## Input Format\n\nYou will receive:\n- **INSTRUCTIONS**: User's modification request\n- **CODE**: Current code content with modification boundaries\n- **DATABASES** *(optional)*: Available workspace databases\n\n### Code Boundaries\n\nThe code contains `[#START]` and `[#END]` markers indicating the modification scope:\n- **MUST** only modify code between these markers\n- **MUST** remove the markers in your response\n- **MUST** preserve all other code exactly as provided\n\n## Task Requirements\n\nReturn the modified CODE that fulfills the user's request. Assume all user queries are valid and actionable.\n\n### Critical Rules\n\n- \u2705 **ALWAYS** include a single code block with the entire updated CODE\n- \u2705 **ALWAYS** use the structured XML output format below\n- \u274C **NEVER** include only modified sections\n- \u274C **NEVER** add explanatory text or comments outside the format\n- \u274C **NEVER** include ``` code fences in your response\n- \u274C **NEVER** modify the code outside the boundaries\n\n## Output Format\n\n```xml\n<changes_made>\nBrief description of what was changed\n</changes_made>\n<new_code>\n[complete modified code without markers]\n</new_code>\n```\n\n## Example\n\n### Input:\n```xml\n<user_request>\nINSTRUCTIONS:\nReturn 2 instead of 1\n\nCODE:\nimport * as wmill from \"windmill-client\"\n\nfunction test() {\n\treturn \"hello\"\n}\n\n[#START]\nexport async function main() {\n\treturn 1;\n}\n[#END]\n</user_request>\n```\n\n### Expected Output:\n```xml\n<changes_made>\nChanged return value from 1 to 2 in main function\n</changes_made>\n<new_code>\nimport * as wmill from \"windmill-client\"\n\nfunction test() {\n\treturn \"hello\"\n}\n\nexport async function main() {\n\treturn 2;\n}\n</new_code>\n```\n";
15
15
  export declare const CHAT_USER_PROMPT = "\nINSTRUCTIONS:\n{instructions}\n\nWINDMILL LANGUAGE CONTEXT:\n{lang_context}\n\n";
16
16
  export declare const CHAT_USER_DB_CONTEXT = "- {title}: SCHEMA: \n{schema}\n";
@@ -18,10 +18,17 @@ export declare function prepareScriptSystemMessage(): ChatCompletionSystemMessag
18
18
  export declare function prepareScriptTools(language: ScriptLang | 'bunnative', context: ContextElement[]): Tool<ScriptChatHelpers>[];
19
19
  export declare function prepareScriptUserMessage(instructions: string, language: ScriptLang | 'bunnative', selectedContext: ContextElement[], options?: {
20
20
  isPreprocessor?: boolean;
21
- }): Promise<ChatCompletionUserMessageParam>;
21
+ }): ChatCompletionUserMessageParam;
22
22
  export declare const MAX_SCHEMA_LENGTH: number;
23
23
  export interface ScriptChatHelpers {
24
- getLang: () => ScriptLang | 'bunnative';
24
+ getScriptOptions: () => {
25
+ code: string;
26
+ lang: ScriptLang | 'bunnative';
27
+ path: string;
28
+ args: Record<string, any>;
29
+ };
30
+ getLastSuggestedCode: () => string | undefined;
31
+ applyCode: (code: string, applyAll?: boolean) => void;
25
32
  }
26
33
  export declare const resourceTypeTool: Tool<ScriptChatHelpers>;
27
34
  export declare const dbSchemaTool: Tool<ScriptChatHelpers>;
@@ -34,3 +41,4 @@ export declare function fetchNpmPackageTypes(packageName: string, version?: stri
34
41
  types: string;
35
42
  error?: string;
36
43
  }>;
44
+ export declare const testRunScriptTool: Tool<ScriptChatHelpers>;