windmill-components 1.309.7 → 1.339.2

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 (382) hide show
  1. package/package/assets/app.css +22 -1
  2. package/package/autosize.js +1 -1
  3. package/package/common.d.ts +8 -0
  4. package/package/common.js +5 -1
  5. package/package/components/AllFlowLogs.svelte +30 -0
  6. package/package/components/AllFlowLogs.svelte.d.ts +18 -0
  7. package/package/components/ApiConnectForm.svelte +10 -4
  8. package/package/components/AppConnectDrawer.svelte +74 -0
  9. package/package/components/AppConnectDrawer.svelte.d.ts +20 -0
  10. package/package/components/AppConnectInner.svelte +513 -0
  11. package/package/components/AppConnectInner.svelte.d.ts +28 -0
  12. package/package/components/ArgInfo.svelte +19 -3
  13. package/package/components/ArgInput.svelte +73 -16
  14. package/package/components/ArgInput.svelte.d.ts +4 -0
  15. package/package/components/ConcurrentJobsChart.svelte +212 -0
  16. package/package/components/ConcurrentJobsChart.svelte.d.ts +23 -0
  17. package/package/components/CustomOauth.svelte +2 -2
  18. package/package/components/DateInput.svelte +47 -0
  19. package/package/components/DateInput.svelte.d.ts +24 -0
  20. package/package/components/DateTimeInput.svelte +25 -3
  21. package/package/components/DefaultScripts.svelte +5 -8
  22. package/package/components/DefaultTags.svelte +3 -2
  23. package/package/components/DefaultTags.svelte.d.ts +3 -1
  24. package/package/components/DefaultTagsInner.svelte +1 -10
  25. package/package/components/DefaultTagsInner.svelte.d.ts +3 -1
  26. package/package/components/Dev.svelte +70 -9
  27. package/package/components/DiffEditor.svelte +3 -0
  28. package/package/components/DisplayResult.svelte +186 -123
  29. package/package/components/DisplayResult.svelte.d.ts +1 -0
  30. package/package/components/DropdownV2.svelte.d.ts +2 -2
  31. package/package/components/EditableSchemaForm.svelte +3 -0
  32. package/package/components/Editor.svelte +110 -93
  33. package/package/components/Editor.svelte.d.ts +4 -2
  34. package/package/components/EditorBar.svelte +99 -8
  35. package/package/components/EditorBar.svelte.d.ts +0 -1
  36. package/package/components/ErrorOrRecoveryHandler.svelte +0 -1
  37. package/package/components/FlowGraphViewer.svelte +1 -0
  38. package/package/components/FlowGraphViewerStep.svelte +19 -1
  39. package/package/components/FlowJobResult.svelte +13 -0
  40. package/package/components/FlowJobResult.svelte.d.ts +3 -0
  41. package/package/components/FlowMetadata.svelte +40 -35
  42. package/package/components/FlowMetadata.svelte.d.ts +3 -1
  43. package/package/components/FlowPreviewContent.svelte +13 -6
  44. package/package/components/FlowStatusViewerInner.svelte +46 -2
  45. package/package/components/HighlightCode.svelte +3 -0
  46. package/package/components/InputTransformForm.svelte +3 -0
  47. package/package/components/InstanceSettings.svelte +163 -16
  48. package/package/components/InstanceSettings.svelte.d.ts +2 -0
  49. package/package/components/JobLogs.svelte +12 -0
  50. package/package/components/JobLogs.svelte.d.ts +16 -0
  51. package/package/components/JobStatus.svelte +1 -1
  52. package/package/components/Label.svelte +1 -1
  53. package/package/components/Label.svelte.d.ts +1 -0
  54. package/package/components/LightweightArgInput.svelte +294 -268
  55. package/package/components/LightweightArgInput.svelte.d.ts +3 -0
  56. package/package/components/LightweightResourcePicker.svelte +74 -26
  57. package/package/components/LightweightSchemaForm.svelte +25 -24
  58. package/package/components/LogViewer.svelte +52 -15
  59. package/package/components/LogViewer.svelte.d.ts +1 -0
  60. package/package/components/Login.svelte +288 -0
  61. package/package/components/Login.svelte.d.ts +19 -0
  62. package/package/components/ModulePreviewForm.svelte +3 -0
  63. package/package/components/NoMainFuncBadge.svelte +8 -0
  64. package/package/components/NoMainFuncBadge.svelte.d.ts +14 -0
  65. package/package/components/OauthExtraParams.svelte +1 -1
  66. package/package/components/OauthScopes.svelte +1 -1
  67. package/package/components/ObjectStoreConfigSettings.svelte +12 -1
  68. package/package/components/ObjectStoreConfigSettings.svelte.d.ts +1 -0
  69. package/package/components/ParqetTableRenderer.svelte +12 -16
  70. package/package/components/Password.svelte +1 -0
  71. package/package/components/Password.svelte.d.ts +2 -0
  72. package/package/components/PasswordArgInput.svelte +49 -0
  73. package/package/components/PasswordArgInput.svelte.d.ts +17 -0
  74. package/package/components/PropertyRow.svelte +10 -2
  75. package/package/components/QueueMetricsDrawer.svelte +225 -0
  76. package/package/components/QueueMetricsDrawer.svelte.d.ts +18 -0
  77. package/package/components/ResourceEditor.svelte +1 -0
  78. package/package/components/ResourcePicker.svelte +3 -7
  79. package/package/components/ResultJobLoader.svelte +2 -2
  80. package/package/components/ResultJobLoader.svelte.d.ts +9 -9
  81. package/package/components/S3FilePicker.svelte +1 -1
  82. package/package/components/SavedInputs.svelte +49 -13
  83. package/package/components/ScheduleEditorInner.svelte +255 -228
  84. package/package/components/SchemaEditor.svelte +5 -3
  85. package/package/components/SchemaEditor.svelte.d.ts +2 -0
  86. package/package/components/SchemaForm.svelte +5 -0
  87. package/package/components/SchemaForm.svelte.d.ts +1 -0
  88. package/package/components/SchemaModal.svelte +101 -8
  89. package/package/components/SchemaModal.svelte.d.ts +2 -0
  90. package/package/components/ScriptBuilder.svelte +10 -6
  91. package/package/components/ScriptEditor.svelte +1 -2
  92. package/package/components/ScriptEditor.svelte.d.ts +1 -1
  93. package/package/components/SimpleEditor.svelte +4 -1
  94. package/package/components/StringTypeNarrowing.svelte +43 -24
  95. package/package/components/StringTypeNarrowing.svelte.d.ts +1 -0
  96. package/package/components/TemplateEditor.svelte +1 -0
  97. package/package/components/TestJobLoader.svelte +14 -5
  98. package/package/components/TestJobLoader.svelte.d.ts +1 -1
  99. package/package/components/Toggle.svelte +1 -1
  100. package/package/components/Tooltip.svelte +8 -2
  101. package/package/components/Tooltip.svelte.d.ts +1 -0
  102. package/package/components/WorkspaceGroup.svelte +74 -9
  103. package/package/components/WorkspaceGroup.svelte.d.ts +1 -0
  104. package/package/components/app_connect.d.ts +7 -0
  105. package/package/components/app_connect.js +78 -0
  106. package/package/components/apps/components/buttons/AppButton.svelte +0 -1
  107. package/package/components/apps/components/display/AppAlert.svelte +1 -1
  108. package/package/components/apps/components/display/AppCustomComponent.svelte +1 -1
  109. package/package/components/apps/components/display/AppDisplayComponent.svelte +2 -2
  110. package/package/components/apps/components/display/AppDownload.svelte +1 -1
  111. package/package/components/apps/components/display/AppIcon.svelte +1 -1
  112. package/package/components/apps/components/display/AppJobIdFlowStatus.svelte +2 -2
  113. package/package/components/apps/components/display/AppJobIdLogComponent.svelte +3 -3
  114. package/package/components/apps/components/display/AppMap.svelte +3 -2
  115. package/package/components/apps/components/display/AppMenu.svelte +1 -1
  116. package/package/components/apps/components/display/AppPdf.svelte +3 -11
  117. package/package/components/apps/components/display/AppText.svelte +7 -2
  118. package/package/components/apps/components/display/charts/AppAgCharts.svelte +6 -3
  119. package/package/components/apps/components/display/dbtable/AppDbExplorer.svelte +32 -30
  120. package/package/components/apps/components/display/dbtable/InsertRow.svelte +3 -6
  121. package/package/components/apps/components/display/dbtable/queries/delete.js +1 -1
  122. package/package/components/apps/components/display/dbtable/queries/insert.js +1 -12
  123. package/package/components/apps/components/display/dbtable/queries/select.js +1 -1
  124. package/package/components/apps/components/display/dbtable/queries/update.js +2 -2
  125. package/package/components/apps/components/display/dbtable/utils.d.ts +0 -1
  126. package/package/components/apps/components/display/dbtable/utils.js +0 -83
  127. package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte +75 -44
  128. package/package/components/apps/components/display/table/AppAggridExplorerTable.svelte.d.ts +5 -1
  129. package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte +172 -0
  130. package/package/components/apps/components/display/table/AppAggridInfiniteTable.svelte.d.ts +27 -0
  131. package/package/components/apps/components/display/table/AppAggridInfiniteTableEe.svelte +38 -0
  132. package/package/components/apps/components/display/table/AppAggridInfiniteTableEe.svelte.d.ts +28 -0
  133. package/package/components/apps/components/display/table/AppAggridTable.svelte +189 -56
  134. package/package/components/apps/components/display/table/AppAggridTable.svelte.d.ts +1 -1
  135. package/package/components/apps/components/display/table/AppAggridTableActions.svelte +11 -2
  136. package/package/components/apps/components/display/table/AppAggridTableActions.svelte.d.ts +1 -0
  137. package/package/components/apps/components/display/table/AppCell.svelte +1 -3
  138. package/package/components/apps/components/display/table/AppTable.svelte +320 -281
  139. package/package/components/apps/components/display/table/AppTableFooter.svelte +42 -23
  140. package/package/components/apps/components/display/table/AppTableFooter.svelte.d.ts +2 -2
  141. package/package/components/apps/components/display/table/SyncColumnDefs.svelte +119 -0
  142. package/package/components/apps/components/display/table/SyncColumnDefs.svelte.d.ts +21 -0
  143. package/package/components/apps/components/display/table/theme/windmill-theme.css +656 -0
  144. package/package/components/apps/components/display/table/utils.js +22 -0
  145. package/package/components/apps/components/helpers/DebouncedInput.svelte +3 -2
  146. package/package/components/apps/components/helpers/NonRunnableComponent.svelte +35 -0
  147. package/package/components/apps/components/helpers/RefreshButton.svelte +30 -12
  148. package/package/components/apps/components/helpers/RefreshButton.svelte.d.ts +1 -3
  149. package/package/components/apps/components/helpers/RefreshIndicator.svelte +19 -0
  150. package/package/components/apps/components/helpers/RefreshIndicator.svelte.d.ts +16 -0
  151. package/package/components/apps/components/helpers/ResolveConfig.svelte +1 -1
  152. package/package/components/apps/components/helpers/RunnableComponent.svelte +86 -35
  153. package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +8 -5
  154. package/package/components/apps/components/helpers/RunnableWrapper.svelte +7 -1
  155. package/package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +5 -0
  156. package/package/components/apps/components/inputs/AppDateInput.svelte +5 -1
  157. package/package/components/apps/components/inputs/AppFileInput.svelte +11 -2
  158. package/package/components/apps/components/inputs/AppMultiSelect.svelte +56 -50
  159. package/package/components/apps/components/inputs/AppMultiSelect.svelte.d.ts +1 -0
  160. package/package/components/apps/components/inputs/AppMultiSelectV2.svelte +178 -0
  161. package/package/components/apps/components/inputs/AppMultiSelectV2.svelte.d.ts +24 -0
  162. package/package/components/apps/components/inputs/AppNumberInput.svelte +1 -1
  163. package/package/components/apps/components/inputs/AppQuillEditor.svelte +26 -0
  164. package/package/components/apps/components/inputs/AppRangeInput.svelte +38 -37
  165. package/package/components/apps/components/inputs/AppSelect.svelte +21 -10
  166. package/package/components/apps/components/inputs/AppSliderInputs.svelte +26 -31
  167. package/package/components/apps/components/inputs/AppTextInput.svelte +1 -1
  168. package/package/components/apps/components/inputs/currency/AppCurrencyInput.svelte +1 -1
  169. package/package/components/apps/components/layout/AppConditionalWrapper.svelte +7 -2
  170. package/package/components/apps/components/layout/AppContainer.svelte +1 -1
  171. package/package/components/apps/components/layout/AppDecisionTree.svelte +1 -1
  172. package/package/components/apps/components/layout/AppDrawer.svelte +16 -3
  173. package/package/components/apps/components/layout/AppDrawer.svelte.d.ts +2 -0
  174. package/package/components/apps/components/layout/AppModal.svelte +85 -79
  175. package/package/components/apps/components/layout/AppModal.svelte.d.ts +2 -0
  176. package/package/components/apps/components/layout/AppStepper.svelte +2 -1
  177. package/package/components/apps/components/layout/AppTabs.svelte +1 -1
  178. package/package/components/apps/editor/AppEditor.svelte +3 -2
  179. package/package/components/apps/editor/AppEditorHeader.svelte +62 -31
  180. package/package/components/apps/editor/AppInputs.svelte +1 -1
  181. package/package/components/apps/editor/AppPreview.svelte +18 -7
  182. package/package/components/apps/editor/ComponentHeader.svelte +37 -1
  183. package/package/components/apps/editor/ComponentHeader.svelte.d.ts +2 -0
  184. package/package/components/apps/editor/GridEditor.svelte +15 -6
  185. package/package/components/apps/editor/GridEditorMenu.svelte +120 -49
  186. package/package/components/apps/editor/GridViewer.svelte +14 -5
  187. package/package/components/apps/editor/GridViewer.svelte.d.ts +5 -1
  188. package/package/components/apps/editor/RecomputeAllComponents.svelte +17 -3
  189. package/package/components/apps/editor/RunnableJobPanel.svelte +9 -5
  190. package/package/components/apps/editor/SettingsPanel.svelte +6 -2
  191. package/package/components/apps/editor/SubGridEditor.svelte +44 -27
  192. package/package/components/apps/editor/appUtils.d.ts +6 -1
  193. package/package/components/apps/editor/appUtils.js +85 -7
  194. package/package/components/apps/editor/component/Component.svelte +78 -2
  195. package/package/components/apps/editor/component/Component.svelte.d.ts +3 -0
  196. package/package/components/apps/editor/component/components.d.ts +274 -21
  197. package/package/components/apps/editor/component/components.js +176 -12
  198. package/package/components/apps/editor/component/default-codes.d.ts +1 -1
  199. package/package/components/apps/editor/component/default-codes.js +241 -9
  200. package/package/components/apps/editor/component/sets.d.ts +3 -0
  201. package/package/components/apps/editor/component/sets.js +12 -2
  202. package/package/components/apps/editor/componentsPanel/ComponentList.svelte +15 -2
  203. package/package/components/apps/editor/componentsPanel/componentControlUtils.js +4 -2
  204. package/package/components/apps/editor/componentsPanel/cssUtils.js +1 -1
  205. package/package/components/apps/editor/componentsPanel/quickStyleProperties.js +5 -0
  206. package/package/components/apps/editor/contextPanel/components/OutputHeader.svelte +9 -5
  207. package/package/components/apps/editor/contextPanel/components/TableActionsOutput.svelte +1 -1
  208. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptEditor.svelte +46 -6
  209. package/package/components/apps/editor/inlineScriptsPanel/InlineScriptsPanelWithTable.svelte +1 -1
  210. package/package/components/apps/editor/inlineScriptsPanel/utils.js +3 -1
  211. package/package/components/apps/editor/settingsPanel/AlignmentEditor.svelte +1 -1
  212. package/package/components/apps/editor/settingsPanel/ComponentControl.svelte +1 -1
  213. package/package/components/apps/editor/settingsPanel/ComponentInputTypeEditor.svelte +8 -5
  214. package/package/components/apps/editor/settingsPanel/ComponentPanel.svelte +54 -4
  215. package/package/components/apps/editor/settingsPanel/ContextVariables.svelte +61 -0
  216. package/package/components/apps/editor/settingsPanel/ContextVariables.svelte.d.ts +16 -0
  217. package/package/components/apps/editor/settingsPanel/DecisionTreeGraphEditor.svelte +12 -10
  218. package/package/components/apps/editor/settingsPanel/DeleteComponent.svelte +29 -32
  219. package/package/components/apps/editor/settingsPanel/DeleteComponent.svelte.d.ts +0 -5
  220. package/package/components/apps/editor/settingsPanel/GridCondition.svelte +27 -25
  221. package/package/components/apps/editor/settingsPanel/GridTab.svelte +1 -1
  222. package/package/components/apps/editor/settingsPanel/GridTabDisabled.svelte +2 -1
  223. package/package/components/apps/editor/settingsPanel/GridTabDisabled.svelte.d.ts +1 -0
  224. package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +24 -3
  225. package/package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte +27 -1
  226. package/package/components/apps/editor/settingsPanel/InputsSpecsEditor.svelte.d.ts +1 -0
  227. package/package/components/apps/editor/settingsPanel/Recompute.svelte +1 -1
  228. package/package/components/apps/editor/settingsPanel/StylePanel.svelte +4 -3
  229. package/package/components/apps/editor/settingsPanel/inputEditor/ColorInput.svelte +3 -2
  230. package/package/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte +1 -0
  231. package/package/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte +4 -4
  232. package/package/components/apps/editor/settingsPanel/secondaryMenu/SecondaryMenu.svelte +6 -3
  233. package/package/components/apps/inputType.d.ts +4 -0
  234. package/package/components/apps/rx.d.ts +1 -1
  235. package/package/components/apps/rx.js +7 -0
  236. package/package/components/apps/svelte-grid/Grid.svelte +13 -4
  237. package/package/components/apps/svelte-grid/Grid.svelte.d.ts +2 -1
  238. package/package/components/apps/svelte-grid/types.d.ts +1 -0
  239. package/package/components/apps/svelte-grid/utils/helper.js +1 -0
  240. package/package/components/apps/svelte-grid/utils/overlap.d.ts +3 -0
  241. package/package/components/apps/svelte-grid/utils/overlap.js +21 -0
  242. package/package/components/apps/svelte-select/lib/Select.svelte.d.ts +2 -2
  243. package/package/components/apps/svelte-select/lib/tailwind.css +1 -1
  244. package/package/components/apps/types.d.ts +1 -0
  245. package/package/components/apps/utils.js +13 -3
  246. package/package/components/auditLogs/AuditLogsTable.svelte +5 -2
  247. package/package/components/build_workers.js +1 -0
  248. package/package/components/common/alert/Alert.svelte +17 -17
  249. package/package/components/common/badge/Badge.svelte +6 -3
  250. package/package/components/common/badge/model.d.ts +1 -1
  251. package/package/components/common/button/Button.svelte +22 -14
  252. package/package/components/common/calendarPicker/CalendarPicker.svelte +2 -0
  253. package/package/components/common/calendarPicker/CalendarPicker.svelte.d.ts +1 -0
  254. package/package/components/common/drawer/ConditionalPortal.svelte +9 -0
  255. package/package/components/common/drawer/ConditionalPortal.svelte.d.ts +18 -0
  256. package/package/components/common/drawer/Disposable.svelte +66 -0
  257. package/package/components/common/drawer/Disposable.svelte.d.ts +36 -0
  258. package/package/components/common/drawer/Drawer.svelte +29 -55
  259. package/package/components/common/drawer/Drawer.svelte.d.ts +1 -1
  260. package/package/components/common/fileInput/FileInput.svelte +3 -3
  261. package/package/components/common/fileInput/FileInput.svelte.d.ts +1 -0
  262. package/package/components/common/fileUpload/FileUpload.svelte +1 -1
  263. package/package/components/common/languageIcons/LanguageIcon.svelte +5 -2
  264. package/package/components/common/table/RowIcon.svelte +4 -4
  265. package/package/components/common/table/ScriptRow.svelte +12 -1
  266. package/package/components/common/table/ScriptRow.svelte.d.ts +1 -0
  267. package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte +45 -0
  268. package/package/components/common/toggleButton-v2/ToggleButtonMore.svelte.d.ts +24 -0
  269. package/package/components/copilot/CronGen.svelte +2 -2
  270. package/package/components/copilot/FlowCopilotStatus.svelte +1 -1
  271. package/package/components/copilot/RegexGen.svelte +17 -39
  272. package/package/components/copilot/ScriptGen.svelte +14 -5
  273. package/package/components/copilot/StepInputGen.svelte +2 -1
  274. package/package/components/copilot/StepInputsGen.svelte +2 -1
  275. package/package/components/copilot/completion.js +60 -9
  276. package/package/components/copilot/lib.js +5 -3
  277. package/package/components/copilot/prompts/edit.yaml +24 -0
  278. package/package/components/copilot/prompts/editPrompt.d.ts +3 -0
  279. package/package/components/copilot/prompts/editPrompt.js +3 -0
  280. package/package/components/copilot/prompts/fix.yaml +25 -0
  281. package/package/components/copilot/prompts/fixPrompt.d.ts +3 -0
  282. package/package/components/copilot/prompts/fixPrompt.js +3 -0
  283. package/package/components/copilot/prompts/gen.yaml +20 -0
  284. package/package/components/copilot/prompts/genPrompt.d.ts +3 -0
  285. package/package/components/copilot/prompts/genPrompt.js +3 -0
  286. package/package/components/copilot/utils.d.ts +2 -1
  287. package/package/components/copilot/utils.js +38 -0
  288. package/package/components/details/createAppFromScript.d.ts +26 -0
  289. package/package/components/details/createAppFromScript.js +50 -24
  290. package/package/components/flows/CreateActionsApp.svelte +1 -0
  291. package/package/components/flows/CreateActionsFlow.svelte +1 -0
  292. package/package/components/flows/content/FlowInputs.svelte +2 -2
  293. package/package/components/flows/content/FlowModuleComponent.svelte +15 -6
  294. package/package/components/flows/content/ScriptEditorDrawer.svelte +3 -2
  295. package/package/components/flows/flowExplorer.js +4 -1
  296. package/package/components/flows/map/FlowConstantsItem.svelte +1 -1
  297. package/package/components/flows/map/FlowErrorHandlerItem.svelte +1 -1
  298. package/package/components/flows/map/FlowModuleSchemaItem.svelte +3 -0
  299. package/package/components/flows/map/FlowModuleSchemaItem.svelte.d.ts +1 -0
  300. package/package/components/flows/map/FlowSettingsItem.svelte +1 -1
  301. package/package/components/flows/map/MapItem.svelte +2 -0
  302. package/package/components/flows/map/MapItem.svelte.d.ts +1 -0
  303. package/package/components/graph/FlowGraph.svelte +1 -0
  304. package/package/components/graph/svelvet/edges/views/Edges/SimpleBezierEdge.svelte +41 -16
  305. package/package/components/home/ItemsList.svelte +44 -9
  306. package/package/components/home/TreeView.svelte +2 -0
  307. package/package/components/icons/AzureIcon.svelte +25 -1
  308. package/package/components/icons/PHPIcon.svelte +117 -0
  309. package/package/components/icons/PHPIcon.svelte.d.ts +17 -0
  310. package/package/components/instanceSettings.d.ts +1 -1
  311. package/package/components/instanceSettings.js +18 -2
  312. package/package/components/jobs/JobPreview.svelte +5 -0
  313. package/package/components/multiselect/MultiSelect.svelte +782 -0
  314. package/package/components/multiselect/MultiSelect.svelte.d.ts +97 -0
  315. package/package/components/multiselect/types.d.ts +56 -0
  316. package/package/components/multiselect/types.js +1 -0
  317. package/package/components/multiselect/utils.d.ts +7 -0
  318. package/package/components/multiselect/utils.js +54 -0
  319. package/package/components/propertyPicker/ObjectViewer.svelte +14 -1
  320. package/package/components/runs/JobLoader.svelte +135 -17
  321. package/package/components/runs/JobLoader.svelte.d.ts +7 -2
  322. package/package/components/runs/JobPreview.svelte +39 -3
  323. package/package/components/runs/JobPreview.svelte.d.ts +2 -0
  324. package/package/components/runs/RunRow.svelte +78 -31
  325. package/package/components/runs/RunRow.svelte.d.ts +3 -0
  326. package/package/components/runs/RunsFilter.svelte +125 -9
  327. package/package/components/runs/RunsFilter.svelte.d.ts +4 -2
  328. package/package/components/runs/RunsTable.svelte +53 -5
  329. package/package/components/runs/RunsTable.svelte.d.ts +6 -0
  330. package/package/components/scriptEditor/LogPanel.svelte +46 -33
  331. package/package/components/scriptEditor/LogPanel.svelte.d.ts +1 -0
  332. package/package/components/scripts/CreateActionsScript.svelte +1 -1
  333. package/package/components/settings/WorkspaceUserSettings.svelte +246 -226
  334. package/package/components/sidebar/MenuButton.svelte +1 -1
  335. package/package/components/sidebar/MenuLink.svelte +1 -1
  336. package/package/components/sidebar/changelogs.js +40 -0
  337. package/package/components/table/AutoDataTable.svelte +77 -102
  338. package/package/components/table/DataTable.svelte +13 -5
  339. package/package/components/table/DataTable.svelte.d.ts +1 -0
  340. package/package/components/vscode.js +1 -1
  341. package/package/components/wizards/AgGridWizard.svelte +27 -2
  342. package/package/components/wizards/AgGridWizard.svelte.d.ts +1 -0
  343. package/package/consts.js +5 -1
  344. package/package/defaults.d.ts +2 -2
  345. package/package/defaults.js +2 -2
  346. package/package/deno_fetch.d.ts.txt +30 -0
  347. package/package/editorUtils.js +2 -0
  348. package/package/gen/core/OpenAPI.js +5 -6
  349. package/package/gen/core/request.js +4 -1
  350. package/package/gen/index.d.ts +0 -1
  351. package/package/gen/index.js +0 -1
  352. package/package/gen/schemas.gen.d.ts +97 -428
  353. package/package/gen/schemas.gen.js +97 -433
  354. package/package/gen/services.gen.d.ts +3087 -1840
  355. package/package/gen/services.gen.js +3442 -2358
  356. package/package/gen/types.gen.d.ts +5048 -1505
  357. package/package/infer.d.ts +1 -1
  358. package/package/infer.js +6 -2
  359. package/package/inferArgSig.js +5 -2
  360. package/package/init_scripts/python_init_code.d.ts +1 -1
  361. package/package/init_scripts/python_init_code.js +1 -1
  362. package/package/process.d.ts.txt +1770 -0
  363. package/package/script_helpers.d.ts +3 -2
  364. package/package/script_helpers.js +28 -3
  365. package/package/scripts.d.ts +1 -1
  366. package/package/scripts.js +4 -0
  367. package/package/utils.d.ts +3 -0
  368. package/package/utils.js +46 -3
  369. package/package/windmill_fetch.d.ts.txt +16966 -0
  370. package/package/zIndexes.d.ts +12 -0
  371. package/package/zIndexes.js +12 -0
  372. package/package.json +5 -5
  373. package/package/components/AppConnect.svelte +0 -566
  374. package/package/components/AppConnect.svelte.d.ts +0 -23
  375. package/package/components/ContextMenu.svelte +0 -89
  376. package/package/components/ContextMenu.svelte.d.ts +0 -28
  377. package/package/components/apps/components/display/index.d.ts +0 -17
  378. package/package/components/apps/components/display/index.js +0 -17
  379. package/package/components/apps/components/helpers/index.d.ts +0 -10
  380. package/package/components/apps/components/helpers/index.js +0 -10
  381. package/package/components/apps/components/index.d.ts +0 -5
  382. package/package/components/apps/components/index.js +0 -5
@@ -3,26 +3,23 @@ import { getNonStreamingCompletion } from './lib';
3
3
  import { sendUserToast } from '../../toast';
4
4
  import Popup from '../common/popup/Popup.svelte';
5
5
  import { copilotInfo } from '../../stores';
6
- import { WindmillIcon } from '../icons';
7
6
  import { autoPlacement } from '@floating-ui/core';
8
7
  import { ExternalLink, HistoryIcon, Wand2 } from 'lucide-svelte';
9
- import { fade } from 'svelte/transition';
10
8
  import { createEventDispatcher } from 'svelte';
11
9
  // state
12
10
  let funcDesc = '';
13
11
  let genLoading = false;
14
12
  let input;
15
13
  let abortController = undefined;
16
- let button;
17
14
  const dispatch = createEventDispatcher();
18
- async function onGenerate(closePopup) {
15
+ async function onGenerate() {
19
16
  if (funcDesc.length <= 0) {
20
17
  return;
21
18
  }
22
19
  savePrompt();
20
+ genLoading = true;
21
+ abortController = new AbortController();
23
22
  try {
24
- genLoading = true;
25
- abortController = new AbortController();
26
23
  const res = await getNonStreamingCompletion([
27
24
  {
28
25
  role: 'system',
@@ -34,16 +31,11 @@ async function onGenerate(closePopup) {
34
31
  }
35
32
  ], abortController);
36
33
  dispatch('gen', { res: res, prompt: funcDesc });
37
- closePopup();
38
34
  funcDesc = '';
39
35
  }
40
36
  catch (err) {
41
- if (err?.message) {
42
- sendUserToast('Failed to generate regex: ' + err.message, true);
43
- }
44
- else {
45
- sendUserToast('Failed to generate regex', true);
46
- console.error(err);
37
+ if (!abortController.signal.aborted) {
38
+ sendUserToast('Failed to generate regex: ' + err, true);
47
39
  }
48
40
  }
49
41
  finally {
@@ -87,10 +79,6 @@ function clearPromptHistory() {
87
79
  }
88
80
  </script>
89
81
 
90
- {#if genLoading}
91
- <div transition:fade class="fixed z-[4999] inset-0 bg-gray-500/75" />
92
- {/if}
93
-
94
82
  <Popup
95
83
  floatingConfig={{
96
84
  middleware: [
@@ -104,28 +92,16 @@ function clearPromptHistory() {
104
92
  <svelte:fragment slot="button">
105
93
  <Button
106
94
  title="Generate regexes from prompt"
107
- btnClasses={'!font-medium ' + (genLoading ? 'z-[5000]' : '')}
108
- size="xs"
95
+ btnClasses="text-violet-800 dark:text-violet-400 bg-violet-100 dark:bg-gray-700"
96
+ size="sm"
109
97
  color={genLoading ? 'red' : 'light'}
110
98
  spacingSize="md"
111
- startIcon={genLoading ? undefined : { icon: Wand2 }}
99
+ startIcon={{ icon: Wand2 }}
100
+ loading={genLoading}
112
101
  propagateEvent
102
+ clickableWhileLoading
113
103
  on:click={genLoading ? () => abortController?.abort() : () => {}}
114
- bind:element={button}
115
- >
116
- {#if genLoading}
117
- <WindmillIcon
118
- white={true}
119
- class="mr-1 text-white"
120
- height="16px"
121
- width="20px"
122
- spin="veryfast"
123
- />
124
- Stop
125
- {:else}
126
- AI
127
- {/if}
128
- </Button>
104
+ />
129
105
  </svelte:fragment>
130
106
  <div class="block text-primary z-[2000]">
131
107
  {#if $copilotInfo.exists_openai_resource_path}
@@ -137,19 +113,21 @@ function clearPromptHistory() {
137
113
  bind:value={funcDesc}
138
114
  on:keypress={({ key }) => {
139
115
  if (key === 'Enter' && funcDesc.length > 0) {
140
- onGenerate(() => close(input || null))
116
+ close(input || null)
117
+ onGenerate()
141
118
  }
142
119
  }}
143
120
  placeholder={'Describe what the regex should do'}
144
121
  />
145
122
  <Button
146
123
  size="xs"
147
- color="blue"
124
+ color="light"
148
125
  buttonType="button"
149
- btnClasses="!p-1 !w-[38px] !ml-2"
126
+ btnClasses="!ml-2 text-violet-800 dark:text-violet-400 bg-violet-100 dark:bg-gray-700"
150
127
  aria-label="Generate"
151
128
  on:click={() => {
152
- onGenerate(() => close(input || null))
129
+ close(input || null)
130
+ onGenerate()
153
131
  }}
154
132
  disabled={funcDesc.length <= 0}
155
133
  iconOnly
@@ -179,13 +179,20 @@ function clearPromptHistory() {
179
179
  }
180
180
  $: lang && getPromptHistory();
181
181
  $: $generatedCode && updateScroll();
182
+ let innerWidth = 0;
182
183
  function autoResize() {
183
184
  if (input) {
184
- const maxLinesHeight = 100; // Adjust this value based on your font size and line-height to fit 5 lines
185
+ const maxLinesHeight = innerWidth > 2500 ? 146 : 130; // Adjust this value based on your font size and line-height to fit 5 lines
185
186
  input.style.height = 'auto'; // Reset height to recalibrate
186
- const newHeight = Math.min(input.scrollHeight, maxLinesHeight); // Calculate new height, but not exceed max
187
+ const newHeight = Math.min(input.scrollHeight + 2, maxLinesHeight); // Calculate new height, but not exceed max
187
188
  input.style.height = newHeight + 'px'; // Set new height
188
- input.style.overflowY = newHeight >= maxLinesHeight ? 'scroll' : 'hidden'; // Show scrollbar if at max height
189
+ if (input.scrollHeight + 2 > maxLinesHeight) {
190
+ input.scrollTop = input.scrollHeight;
191
+ input.style.overflowY = 'scroll';
192
+ }
193
+ else {
194
+ input.style.overflowY = 'hidden';
195
+ }
189
196
  }
190
197
  }
191
198
  onDestroy(() => {
@@ -193,6 +200,8 @@ onDestroy(() => {
193
200
  });
194
201
  </script>
195
202
 
203
+ <svelte:window on:resize={autoResize} bind:innerWidth />
204
+
196
205
  {#if genLoading}
197
206
  <div transition:fade class="fixed z-[4999] inset-0 bg-gray-500/75" />
198
207
  {/if}
@@ -344,7 +353,7 @@ onDestroy(() => {
344
353
  </ToggleButtonGroup>
345
354
 
346
355
  <div class="text-[0.6rem] text-secondary opacity-60 flex flex-row items-center gap-0.5">
347
- GPT-4 Turbo<Bot size={14} />
356
+ GPT-4o<Bot size={14} />
348
357
  </div>
349
358
  </div>
350
359
  <div class="flex w-96 items-start">
@@ -368,7 +377,7 @@ onDestroy(() => {
368
377
  size="xs"
369
378
  color="light"
370
379
  buttonType="button"
371
- btnClasses="h-[36px] !p-1 !w-[38px] !ml-2 text-violet-800 dark:text-violet-400 bg-violet-100 dark:bg-gray-700"
380
+ btnClasses="!h-[34px] qhd:!h-[38px] !ml-2 text-violet-800 dark:text-violet-400 bg-violet-100 dark:bg-gray-700"
372
381
  title="Generate code from prompt"
373
382
  aria-label="Generate"
374
383
  on:click={() => {
@@ -73,11 +73,12 @@ The current step is ${selectedId}, you can find the details for the step and pre
73
73
  ${flowDetails}
74
74
  Determine for the input "${argName}", what to pass either from the previous results or the flow inputs.
75
75
  All possibles inputs either start with results. or flow_input. and are followed by the key of the input.
76
+ When the step is in a loop, the iterator value is accessible as flow_input.iter.value
76
77
  Here's a summary of the available data:
77
78
  <available>
78
79
  ${YAML.stringify(availableData)}</available>
79
80
  Favor results and flow_input.iter.value over flow inputs.
80
- If none of the results and flow inputs are appropriate (or a more appropriate for other step inputs), you can also imagine new flow_input properties which we will create programmatically based on what you provide.
81
+ If none of the available results are appropriate, are already used or are more appropriate for other inputs, you can also imagine new flow_input properties which we will create programmatically based on what you provide.
81
82
  Reply with the most probable answer, do not explain or discuss.
82
83
  Use javascript object dot notation to access the properties.
83
84
  Only return the expression without any wrapper.`;
@@ -47,7 +47,8 @@ The current step is ${selectedId}, you can find the details for the step and pre
47
47
  ${flowDetails}
48
48
 
49
49
  Determine for all the inputs "${argNames.join('", "')}", what to pass either from the previous results of the flow inputs.
50
- All possibles inputs either start with results. or flow_input. and are follow by the key of the input.
50
+ All possibles inputs either start with results. or flow_input. and are followed by the key of the input.
51
+ When the step is in a loop, the iterator value is accessible as flow_input.iter.value
51
52
  Here's a summary of the available data:
52
53
  <available>
53
54
  ${YAML.stringify(availableData)}</available>
@@ -2,9 +2,66 @@ import { getNonStreamingCompletion } from './lib';
2
2
  import { codeCompletionLoading } from '../../stores';
3
3
  const systemPrompt = `You are a code completion assistant, return the code that should go instead of the <completion_tokens>.
4
4
 
5
- Only return the completion tokens. Wrap the completion tokens in a code block (\`\`\`lang\n[completion_tokens]\n\`\`\`).
5
+ - Only return the completion tokens. Do not include the surrounding code.
6
+ - Wrap the completion tokens in a code block (\`\`\`{language}\n<completion_tokens>\n\`\`\`).
7
+ - Maintain correct indentation based on the context. Take into account whether there are whitespaces or tabs before the completion tokens.
8
+ - You might need to add additional line breaks at the beginning or end of the completion tokens to make the code syntactically correct.
9
+ - Pay attention to not include tokens that are already present in the code, particularly after the completion like parenteses, brackets, etc.
10
+ - Return None with no code block if you think the code is already complete.
6
11
 
7
- Return \`None\` if you think the code is already complete.`;
12
+ Examples:
13
+
14
+ User:
15
+ \`\`\`typescript
16
+ function greet() {
17
+ <completion_tokens>
18
+ }
19
+ \`\`\`
20
+ Assistant:
21
+ \`\`\`typescript
22
+ console.log('Hello, world!')
23
+ \`\`\`
24
+
25
+ User:
26
+ \`\`\`python
27
+ def main(name: str):
28
+ // log the name <completion_tokens>
29
+ \`\`\`
30
+ Assistant:
31
+ \`\`\`python
32
+ \n print(name)
33
+ \`\`\`
34
+
35
+ User:
36
+ \`\`\`typescript
37
+ function multiplyNumbers(<completion_tokens>)
38
+ \`\`\`
39
+ Assistant:
40
+ \`\`\`typescript
41
+ number1: number, number2: number
42
+ \`\`\`
43
+
44
+ User:
45
+ \`\`\`python
46
+ def greet():
47
+ <completion_tokens>
48
+ \`\`\`
49
+ Assistant:
50
+ \`\`\`python
51
+ print("Hello World!")
52
+ \`\`\`
53
+
54
+ User:
55
+ \`\`\`typescript
56
+ function multiplyNumbers(number1: number, number2: number) {<completion_tokens>}
57
+ \`\`\`
58
+ Assistant:
59
+ \`\`\`typescript
60
+ \n return number1 * number2\n
61
+ \`\`\`
62
+
63
+
64
+ `;
8
65
  const prompt = `\`\`\`{language}
9
66
  {before}<completion_tokens>{after}
10
67
  \`\`\`
@@ -25,15 +82,9 @@ export async function editorCodeCompletion(before, after, lang, abortController)
25
82
  }
26
83
  ];
27
84
  try {
28
- const result = await getNonStreamingCompletion(messages, abortController, 'gpt-3.5-turbo-1106');
85
+ const result = await getNonStreamingCompletion(messages, abortController);
29
86
  const match = result.match(/```[a-zA-Z]+\n([\s\S]*?)\n```/);
30
87
  let completion = match?.[1] || '';
31
- if (completion) {
32
- const previousIndent = before.match(/(\n|^)([ \t]*)$/)?.[2];
33
- if (previousIndent) {
34
- completion = completion.replace(/\n/g, `\n${previousIndent}`);
35
- }
36
- }
37
88
  return completion;
38
89
  }
39
90
  catch (err) {
@@ -7,7 +7,7 @@ export const SUPPORTED_LANGUAGES = new Set(Object.keys(GEN_CONFIG.prompts));
7
7
  const openaiConfig = {
8
8
  temperature: 0,
9
9
  max_tokens: 4096,
10
- model: 'gpt-4-0125-preview',
10
+ model: 'gpt-4o-2024-05-13',
11
11
  seed: 42,
12
12
  stream: true,
13
13
  messages: []
@@ -74,9 +74,11 @@ async function getResourceTypes(scriptOptions) {
74
74
  return resourceTypes;
75
75
  }
76
76
  export async function addResourceTypes(scriptOptions, prompt) {
77
- if (['deno', 'bun', 'nativets', 'python3'].includes(scriptOptions.language)) {
77
+ if (['deno', 'bun', 'nativets', 'python3', 'php'].includes(scriptOptions.language)) {
78
78
  const resourceTypes = await getResourceTypes(scriptOptions);
79
- const resourceTypesText = formatResourceTypes(resourceTypes, scriptOptions.language === 'python3' ? 'python3' : 'typescript');
79
+ const resourceTypesText = formatResourceTypes(resourceTypes, ['deno', 'bun', 'nativets'].includes(scriptOptions.language)
80
+ ? 'typescript'
81
+ : scriptOptions.language);
80
82
  prompt = prompt.replace('{resourceTypes}', resourceTypesText);
81
83
  }
82
84
  return prompt;
@@ -167,6 +167,30 @@ prompts:
167
167
  Only define the type for resources that are actually needed to achieve the function purpose. The resource type name has to be exactly as specified. If the type name conflicts with the imported object, rename the imported object NOT THE TYPE.
168
168
  </contextual_information>
169
169
  My instructions: {description}
170
+ php:
171
+ prompt: |-
172
+ Here's my php code:
173
+ ```php
174
+ {code}
175
+ ```
176
+ <contextual_information>
177
+ You have to write a function in php called "main". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.
178
+ You can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:
179
+ <resourceTypes>
180
+ {resourceTypes}
181
+ </resourceTypes>
182
+ You need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.
183
+ Before defining each type, check if the class already exists using class_exists.
184
+ The resource type name has to be exactly as specified.
185
+ If you need to import libraries, you need to specify them as comments in the following manner before the main function:
186
+ ```
187
+ // require:
188
+ // mylibrary/mylibrary
189
+ // myotherlibrary/myotherlibrary@optionalversion
190
+ ```
191
+ No need to require autoload, it is already done.
192
+ <contextual_information>
193
+ My instructions: {description}
170
194
  frontend:
171
195
  prompt: |-
172
196
  Here's my client-side javascript code:
@@ -40,6 +40,9 @@ export declare const EDIT_PROMPT: {
40
40
  bun: {
41
41
  prompt: string;
42
42
  };
43
+ php: {
44
+ prompt: string;
45
+ };
43
46
  frontend: {
44
47
  prompt: string;
45
48
  };
@@ -40,6 +40,9 @@ export const EDIT_PROMPT = {
40
40
  "bun": {
41
41
  "prompt": "Here's my TypeScript code: \n```typescript\n{code}\n```\n<contextual_information>\nWe have to export a \"main\" function like this: \"export async function main(...)\" and specify the parameter types but do not call it. You should generally return the result.\nIf needed, the standard fetch method is available globally, do not import it.\nYou can take as parameters resources which are dictionaries containing credentials or configuration information. Name the resource parameters like this: \"{resource_type}Resource\". \nThe following resource types are available:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nOnly define the type for resources that are actually needed to achieve the function purpose. The resource type name has to be exactly as specified. If the type name conflicts with the imported object, rename the imported object NOT THE TYPE.\n</contextual_information>\nMy instructions: {description}"
42
42
  },
43
+ "php": {
44
+ "prompt": "Here's my php code: \n```php\n{code}\n```\n<contextual_information>\nYou have to write a function in php called \"main\". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.\nYou can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nYou need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.\nBefore defining each type, check if the class already exists using class_exists.\nThe resource type name has to be exactly as specified.\nIf you need to import libraries, you need to specify them as comments in the following manner before the main function:\n```\n// require:\n// mylibrary/mylibrary\n// myotherlibrary/myotherlibrary@optionalversion\n```\nNo need to require autoload, it is already done.\n<contextual_information>\nMy instructions: {description}"
45
+ },
43
46
  "frontend": {
44
47
  "prompt": "Here's my client-side javascript code: \n```javascript\n{code}\n```\n<contextual_information>\nYou can access the context object with the ctx global variable. \nThe app state is a store that can be used to store data. You can access and update the state object with the state global variable like this: state.foo = 'bar'\nYou can use the goto function to navigate to a specific URL: goto(path: string, newTab?: boolean)\nYou can use the openModal and closeModal functions to open and close a modal: openModal(id: string), closeModal(id: string)\nYou can use the setTab function to manually set the tab of a Tab component: setTab(id: string, index: string)\nYou can use the recompute function to recompute a component: recompute(id: string)\nYou can use the getAgGrid function to get the ag-grid instance of a table: getAgGrid(id: string)\nYou can use the setSelectedIndex function to select a row in a table or an AG Grid table: setSelectedIndex(id: string, index: number)\nThe setValue function is meant to set or force the value of a component: setValue(id: string, value: any)\nYou can validate a specific field of a form: validate(id: string, key: string)\nYou can validate all fields of a form: validateAll(id: string, key: string)\nYou can invalidate a specific field of a form: invalidate(id: string, key: string, error: string)\n</contextual_information>\nMy instructions: {description}"
45
48
  },
@@ -182,3 +182,28 @@ prompts:
182
182
  </contextual_information>
183
183
  I get the following error: {error}
184
184
  Fix my code.
185
+ php:
186
+ prompt: |-
187
+ Here's my php code:
188
+ ```php
189
+ {code}
190
+ ```
191
+ <contextual_information>
192
+ You have to write a function in php called "main". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.
193
+ You can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:
194
+ <resourceTypes>
195
+ {resourceTypes}
196
+ </resourceTypes>
197
+ You need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.
198
+ Before defining each type, check if the class already exists using class_exists.
199
+ The resource type name has to be exactly as specified.
200
+ If you need to import libraries, you need to specify them as comments in the following manner before the main function:
201
+ ```
202
+ // require:
203
+ // mylibrary/mylibrary
204
+ // myotherlibrary/myotherlibrary@optionalversion
205
+ ```
206
+ No need to require autoload, it is already done.
207
+ <contextual_information>
208
+ I get the following error: {error}
209
+ Fix my code.
@@ -40,5 +40,8 @@ export declare const FIX_PROMPT: {
40
40
  bun: {
41
41
  prompt: string;
42
42
  };
43
+ php: {
44
+ prompt: string;
45
+ };
43
46
  };
44
47
  };
@@ -39,6 +39,9 @@ export const FIX_PROMPT = {
39
39
  },
40
40
  "bun": {
41
41
  "prompt": "Here's my TypeScript code: \n```typescript\n{code}\n```\n<contextual_information>\nWe have to export a \"main\" function like this: \"export async function main(...)\" and specify the parameter types but do not call it. You should generally return the result.\nIf needed, the standard fetch method is available globally, do not import it.\nYou can take as parameters resources which are dictionaries containing credentials or configuration information. Name the resource parameters like this: \"{resource_type}Resource\".\nThe following resource types are available:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nOnly define the type for resources that are actually needed to achieve the function purpose. The resource type name has to be exactly as specified. If the type name conflicts with the imported object, rename the imported object NOT THE TYPE.\n</contextual_information>\nI get the following error: {error}\nFix my code."
42
+ },
43
+ "php": {
44
+ "prompt": "Here's my php code: \n```php\n{code}\n```\n<contextual_information>\nYou have to write a function in php called \"main\". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.\nYou can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nYou need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.\nBefore defining each type, check if the class already exists using class_exists.\nThe resource type name has to be exactly as specified.\nIf you need to import libraries, you need to specify them as comments in the following manner before the main function:\n```\n// require:\n// mylibrary/mylibrary\n// myotherlibrary/myotherlibrary@optionalversion\n```\nNo need to require autoload, it is already done.\n<contextual_information>\nI get the following error: {error}\nFix my code."
42
45
  }
43
46
  }
44
47
  };
@@ -119,6 +119,26 @@ prompts:
119
119
  The resource type name has to be exactly as specified (no resource suffix). If the type name conflicts with any imported methods, you have to rename the imported method with the conflicting name.
120
120
  </contextual_information>
121
121
  My instructions: {description}
122
+ php:
123
+ prompt: |-
124
+ <contextual_information>
125
+ You have to write a function in php called "main". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.
126
+ You can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:
127
+ <resourceTypes>
128
+ {resourceTypes}
129
+ </resourceTypes>
130
+ You need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.
131
+ Before defining each type, check if the class already exists using class_exists.
132
+ The resource type name has to be exactly as specified.
133
+ If you need to import libraries, you need to specify them as comments in the following manner before the main function:
134
+ ```
135
+ // require:
136
+ // mylibrary/mylibrary
137
+ // myotherlibrary/myotherlibrary@optionalversion
138
+ ```
139
+ No need to require autoload, it is already done.
140
+ <contextual_information>
141
+ My instructions: {description}
122
142
  frontend:
123
143
  prompt: |-
124
144
  Write client-side javascript code that should {description}.
@@ -40,6 +40,9 @@ export declare const GEN_PROMPT: {
40
40
  bun: {
41
41
  prompt: string;
42
42
  };
43
+ php: {
44
+ prompt: string;
45
+ };
43
46
  frontend: {
44
47
  prompt: string;
45
48
  };
@@ -40,6 +40,9 @@ export const GEN_PROMPT = {
40
40
  "bun": {
41
41
  "prompt": "<contextual_information>\nYou have to write TypeScript code and export a \"main\" function like this: \"export async function main(...)\" and specify the parameter types but do not call it. You should generally return the result.\nThe fetch standard method is available globally.\nYou can take as parameters resources which are dictionaries containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nYou need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.\nThe resource type name has to be exactly as specified (no resource suffix). If the type name conflicts with any imported methods, you have to rename the imported method with the conflicting name.\n</contextual_information>\nMy instructions: {description}"
42
42
  },
43
+ "php": {
44
+ "prompt": "<contextual_information>\nYou have to write a function in php called \"main\". Specify the parameter types. Do not call the main function. You should generally return the result. The script must start with `<?php`.\nYou can take as parameters resources which are classes containing credentials or configuration information. For Windmill to correctly detect the resources to be passed, the resource type name has to be exactly as specified in the following list:\n<resourceTypes>\n{resourceTypes}\n</resourceTypes>\nYou need to define the type of the resources that are needed before the main function, but only include them if they are actually needed to achieve the function purpose.\nBefore defining each type, check if the class already exists using class_exists.\nThe resource type name has to be exactly as specified.\nIf you need to import libraries, you need to specify them as comments in the following manner before the main function:\n```\n// require:\n// mylibrary/mylibrary\n// myotherlibrary/myotherlibrary@optionalversion\n```\nNo need to require autoload, it is already done.\n<contextual_information>\nMy instructions: {description}"
45
+ },
43
46
  "frontend": {
44
47
  "prompt": "Write client-side javascript code that should {description}. \n\n<contextual_information>\nYou can access the context object with the ctx global variable. \nThe app state is a store that can be used to store data. You can access and update the state object with the state global variable like this: state.foo = 'bar'\nYou can use the goto function to navigate to a specific URL: goto(path: string, newTab?: boolean)\nYou can use the openModal and closeModal functions to open and close a modal: openModal(id: string), closeModal(id: string)\nYou can use the setTab function to manually set the tab of a Tab component: setTab(id: string, index: string)\nYou can use the recompute function to recompute a component: recompute(id: string)\nYou can use the getAgGrid function to get the ag-grid instance of a table: getAgGrid(id: string)\nYou can use the setSelectedIndex function to select a row in a table or an AG Grid table: setSelectedIndex(id: string, index: number)\nThe setValue function is meant to set or force the value of a component: setValue(id: string, value: any)\nYou can validate a specific field of a form: validate(id: string, key: string)\nYou can validate all fields of a form: validateAll(id: string, key: string)\nYou can invalidate a specific field of a form: invalidate(id: string, key: string, error: string)\n</contextual_information>"
45
48
  },
@@ -1,5 +1,6 @@
1
1
  import type { Schema } from '../../common';
2
2
  import type { ResourceType } from '../../gen';
3
3
  export declare function pythonCompile(schema: Schema): string;
4
- export declare function formatResourceTypes(resourceTypes: ResourceType[], lang: 'python3' | 'typescript'): string;
4
+ export declare function phpCompile(schema: Schema): string;
5
+ export declare function formatResourceTypes(resourceTypes: ResourceType[], lang: 'python3' | 'typescript' | 'php'): string;
5
6
  export declare function yamlStringifyExceptKeys(obj: any, keys: string[]): string;
@@ -64,6 +64,38 @@ export function pythonCompile(schema) {
64
64
  }
65
65
  return res;
66
66
  }
67
+ export function phpCompile(schema) {
68
+ let res = '';
69
+ const entries = Object.entries(schema.properties);
70
+ if (entries.length === 0) {
71
+ return 'array';
72
+ }
73
+ let i = 0;
74
+ for (let [name, prop] of entries) {
75
+ let typ = 'array';
76
+ if (prop.type === 'array') {
77
+ typ = 'array';
78
+ }
79
+ else if (prop.type === 'string') {
80
+ typ = 'string';
81
+ }
82
+ else if (prop.type === 'number') {
83
+ typ = 'float';
84
+ }
85
+ else if (prop.type === 'integer') {
86
+ typ = 'int';
87
+ }
88
+ else if (prop.type === 'boolean') {
89
+ typ = 'bool';
90
+ }
91
+ res += ` public ${typ} $${name};`;
92
+ i++;
93
+ if (i < entries.length) {
94
+ res += '\n';
95
+ }
96
+ }
97
+ return res;
98
+ }
67
99
  export function formatResourceTypes(resourceTypes, lang) {
68
100
  if (lang === 'python3') {
69
101
  const result = resourceTypes.map((resourceType) => {
@@ -71,6 +103,12 @@ export function formatResourceTypes(resourceTypes, lang) {
71
103
  });
72
104
  return '\n' + result.join('\n\n');
73
105
  }
106
+ else if (lang === 'php') {
107
+ const result = resourceTypes.map((resourceType) => {
108
+ return `class ${toCamel(capitalize(resourceType.name))} {\n${phpCompile(resourceType.schema)}\n}`;
109
+ });
110
+ return '\n' + result.join('\n\n');
111
+ }
74
112
  else {
75
113
  const result = resourceTypes
76
114
  .filter((resourceType) => Boolean(resourceType.schema) && typeof resourceType.schema === 'object')