windmill-cli 1.597.1 → 1.599.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 (251) hide show
  1. package/esm/deps/jsr.io/@std/fs/1.0.20/_create_walk_entry.js +2 -2
  2. package/esm/deps/jsr.io/@std/fs/1.0.20/_is_same_path.js +1 -1
  3. package/esm/deps/jsr.io/@std/fs/1.0.20/_is_subdir.js +2 -2
  4. package/esm/deps/jsr.io/@std/fs/1.0.20/_to_path_string.js +1 -1
  5. package/esm/deps/jsr.io/@std/fs/1.0.20/copy.js +3 -3
  6. package/esm/deps/jsr.io/@std/fs/1.0.20/empty_dir.js +1 -1
  7. package/esm/deps/jsr.io/@std/fs/1.0.20/ensure_file.js +1 -1
  8. package/esm/deps/jsr.io/@std/fs/1.0.20/ensure_link.js +1 -1
  9. package/esm/deps/jsr.io/@std/fs/1.0.20/ensure_symlink.js +2 -2
  10. package/esm/deps/jsr.io/@std/fs/1.0.20/expand_glob.js +6 -6
  11. package/esm/deps/jsr.io/@std/fs/1.0.20/walk.js +1 -1
  12. package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/glob_to_reg_exp.js +2 -1
  13. package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/relative.js +1 -1
  14. package/esm/deps.js +2 -2
  15. package/esm/gen/core/OpenAPI.js +1 -1
  16. package/esm/gen/services.gen.js +16 -0
  17. package/esm/src/commands/app/app.js +4 -0
  18. package/esm/src/commands/app/dev.js +488 -11
  19. package/esm/src/commands/app/generate_agents.js +214 -0
  20. package/esm/src/commands/app/new.js +532 -0
  21. package/esm/src/commands/app/raw_apps.js +74 -10
  22. package/esm/src/commands/sync/sync.js +345 -1
  23. package/esm/src/main.js +1 -1
  24. package/package.json +1 -1
  25. package/types/deps/jsr.io/@std/fs/1.0.20/expand_glob.d.ts +1 -1
  26. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/assert_path.d.ts.map +1 -1
  27. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/basename.d.ts.map +1 -1
  28. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/common.d.ts.map +1 -1
  29. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/constants.d.ts.map +1 -1
  30. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/dirname.d.ts.map +1 -1
  31. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/format.d.ts.map +1 -1
  32. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/from_file_url.d.ts.map +1 -1
  33. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/glob_to_reg_exp.d.ts.map +1 -1
  34. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize.d.ts.map +1 -1
  35. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize_string.d.ts.map +1 -1
  36. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/relative.d.ts.map +1 -1
  37. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/strip_trailing_separators.d.ts.map +1 -1
  38. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/to_file_url.d.ts.map +1 -1
  39. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/basename.d.ts.map +1 -1
  40. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/common.d.ts.map +1 -1
  41. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/constants.d.ts.map +1 -1
  42. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/dirname.d.ts.map +1 -1
  43. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/extname.d.ts.map +1 -1
  44. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/format.d.ts.map +1 -1
  45. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/from_file_url.d.ts.map +1 -1
  46. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/glob_to_regexp.d.ts.map +1 -1
  47. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_absolute.d.ts.map +1 -1
  48. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_glob.d.ts.map +1 -1
  49. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join.d.ts.map +1 -1
  50. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join_globs.d.ts.map +1 -1
  51. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/mod.d.ts.map +1 -1
  52. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize.d.ts.map +1 -1
  53. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize_glob.d.ts.map +1 -1
  54. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/parse.d.ts.map +1 -1
  55. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/_util.d.ts.map +1 -1
  56. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/basename.d.ts.map +1 -1
  57. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/constants.d.ts.map +1 -1
  58. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/dirname.d.ts.map +1 -1
  59. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/extname.d.ts.map +1 -1
  60. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/format.d.ts.map +1 -1
  61. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/from_file_url.d.ts.map +1 -1
  62. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/glob_to_regexp.d.ts.map +1 -1
  63. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/is_absolute.d.ts.map +1 -1
  64. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join.d.ts.map +1 -1
  65. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join_globs.d.ts.map +1 -1
  66. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize.d.ts.map +1 -1
  67. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize_glob.d.ts.map +1 -1
  68. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/parse.d.ts.map +1 -1
  69. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/relative.d.ts.map +1 -1
  70. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/resolve.d.ts.map +1 -1
  71. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_file_url.d.ts.map +1 -1
  72. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_namespaced_path.d.ts.map +1 -1
  73. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/relative.d.ts.map +1 -1
  74. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/resolve.d.ts.map +1 -1
  75. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_file_url.d.ts.map +1 -1
  76. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_namespaced_path.d.ts.map +1 -1
  77. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/types.d.ts.map +1 -1
  78. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/_util.d.ts.map +1 -1
  79. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/basename.d.ts.map +1 -1
  80. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/constants.d.ts.map +1 -1
  81. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/dirname.d.ts.map +1 -1
  82. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/extname.d.ts.map +1 -1
  83. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/format.d.ts.map +1 -1
  84. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/from_file_url.d.ts.map +1 -1
  85. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/glob_to_regexp.d.ts.map +1 -1
  86. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/is_absolute.d.ts.map +1 -1
  87. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join.d.ts.map +1 -1
  88. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join_globs.d.ts.map +1 -1
  89. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize.d.ts.map +1 -1
  90. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize_glob.d.ts.map +1 -1
  91. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/parse.d.ts.map +1 -1
  92. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/relative.d.ts +1 -1
  93. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/relative.d.ts.map +1 -1
  94. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/resolve.d.ts.map +1 -1
  95. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_file_url.d.ts.map +1 -1
  96. package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_namespaced_path.d.ts.map +1 -1
  97. package/types/deps.d.ts +2 -2
  98. package/types/gen/services.gen.d.ts +9 -1
  99. package/types/gen/services.gen.d.ts.map +1 -1
  100. package/types/gen/types.gen.d.ts +18 -0
  101. package/types/gen/types.gen.d.ts.map +1 -1
  102. package/types/src/commands/app/app.d.ts.map +1 -1
  103. package/types/src/commands/app/dev.d.ts.map +1 -1
  104. package/types/src/commands/app/generate_agents.d.ts +15 -0
  105. package/types/src/commands/app/generate_agents.d.ts.map +1 -0
  106. package/types/src/commands/app/new.d.ts +10 -0
  107. package/types/src/commands/app/new.d.ts.map +1 -0
  108. package/types/src/commands/app/raw_apps.d.ts +6 -3
  109. package/types/src/commands/app/raw_apps.d.ts.map +1 -1
  110. package/types/src/commands/sync/sync.d.ts +18 -0
  111. package/types/src/commands/sync/sync.d.ts.map +1 -1
  112. package/types/src/main.d.ts +1 -1
  113. package/types/windmill-utils-internal/src/gen/types.gen.d.ts +18 -0
  114. package/types/windmill-utils-internal/src/gen/types.gen.d.ts.map +1 -1
  115. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/assert_path.js +0 -0
  116. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/basename.js +0 -0
  117. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/common.js +0 -0
  118. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/constants.js +0 -0
  119. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/dirname.js +0 -0
  120. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/format.js +0 -0
  121. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/from_file_url.js +0 -0
  122. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize.js +0 -0
  123. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize_string.js +0 -0
  124. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/relative.js +0 -0
  125. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/strip_trailing_separators.js +0 -0
  126. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/to_file_url.js +0 -0
  127. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/basename.js +0 -0
  128. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/common.js +0 -0
  129. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/constants.js +0 -0
  130. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/dirname.js +0 -0
  131. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/extname.js +0 -0
  132. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/format.js +0 -0
  133. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/from_file_url.js +0 -0
  134. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/glob_to_regexp.js +0 -0
  135. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_absolute.js +0 -0
  136. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_glob.js +0 -0
  137. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join.js +0 -0
  138. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join_globs.js +0 -0
  139. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/mod.js +0 -0
  140. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize.js +0 -0
  141. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize_glob.js +0 -0
  142. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/parse.js +0 -0
  143. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/_util.js +0 -0
  144. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/basename.js +0 -0
  145. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/constants.js +0 -0
  146. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/dirname.js +0 -0
  147. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/extname.js +0 -0
  148. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/format.js +0 -0
  149. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/from_file_url.js +0 -0
  150. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/glob_to_regexp.js +0 -0
  151. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/is_absolute.js +0 -0
  152. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join.js +0 -0
  153. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join_globs.js +0 -0
  154. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize.js +0 -0
  155. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize_glob.js +0 -0
  156. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/parse.js +0 -0
  157. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/relative.js +0 -0
  158. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/resolve.js +0 -0
  159. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_file_url.js +0 -0
  160. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_namespaced_path.js +0 -0
  161. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/relative.js +0 -0
  162. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/resolve.js +0 -0
  163. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_file_url.js +0 -0
  164. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_namespaced_path.js +0 -0
  165. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/types.js +0 -0
  166. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/_util.js +0 -0
  167. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/basename.js +0 -0
  168. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/constants.js +0 -0
  169. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/dirname.js +0 -0
  170. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/extname.js +0 -0
  171. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/format.js +0 -0
  172. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/from_file_url.js +0 -0
  173. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/glob_to_regexp.js +0 -0
  174. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/is_absolute.js +0 -0
  175. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join.js +0 -0
  176. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join_globs.js +0 -0
  177. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize.js +0 -0
  178. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize_glob.js +0 -0
  179. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/parse.js +0 -0
  180. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/resolve.js +0 -0
  181. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_file_url.js +0 -0
  182. /package/esm/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_namespaced_path.js +0 -0
  183. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/assert_path.d.ts +0 -0
  184. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/basename.d.ts +0 -0
  185. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/common.d.ts +0 -0
  186. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/constants.d.ts +0 -0
  187. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/dirname.d.ts +0 -0
  188. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/format.d.ts +0 -0
  189. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/from_file_url.d.ts +0 -0
  190. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/glob_to_reg_exp.d.ts +0 -0
  191. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize.d.ts +0 -0
  192. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/normalize_string.d.ts +0 -0
  193. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/relative.d.ts +0 -0
  194. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/strip_trailing_separators.d.ts +0 -0
  195. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/_common/to_file_url.d.ts +0 -0
  196. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/basename.d.ts +0 -0
  197. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/common.d.ts +0 -0
  198. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/constants.d.ts +0 -0
  199. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/dirname.d.ts +0 -0
  200. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/extname.d.ts +0 -0
  201. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/format.d.ts +0 -0
  202. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/from_file_url.d.ts +0 -0
  203. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/glob_to_regexp.d.ts +0 -0
  204. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_absolute.d.ts +0 -0
  205. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/is_glob.d.ts +0 -0
  206. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join.d.ts +0 -0
  207. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/join_globs.d.ts +0 -0
  208. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/mod.d.ts +0 -0
  209. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize.d.ts +0 -0
  210. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/normalize_glob.d.ts +0 -0
  211. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/parse.d.ts +0 -0
  212. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/_util.d.ts +0 -0
  213. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/basename.d.ts +0 -0
  214. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/constants.d.ts +0 -0
  215. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/dirname.d.ts +0 -0
  216. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/extname.d.ts +0 -0
  217. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/format.d.ts +0 -0
  218. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/from_file_url.d.ts +0 -0
  219. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/glob_to_regexp.d.ts +0 -0
  220. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/is_absolute.d.ts +0 -0
  221. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join.d.ts +0 -0
  222. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/join_globs.d.ts +0 -0
  223. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize.d.ts +0 -0
  224. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/normalize_glob.d.ts +0 -0
  225. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/parse.d.ts +0 -0
  226. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/relative.d.ts +0 -0
  227. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/resolve.d.ts +0 -0
  228. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_file_url.d.ts +0 -0
  229. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/posix/to_namespaced_path.d.ts +0 -0
  230. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/relative.d.ts +0 -0
  231. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/resolve.d.ts +0 -0
  232. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_file_url.d.ts +0 -0
  233. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/to_namespaced_path.d.ts +0 -0
  234. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/types.d.ts +0 -0
  235. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/_util.d.ts +0 -0
  236. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/basename.d.ts +0 -0
  237. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/constants.d.ts +0 -0
  238. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/dirname.d.ts +0 -0
  239. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/extname.d.ts +0 -0
  240. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/format.d.ts +0 -0
  241. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/from_file_url.d.ts +0 -0
  242. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/glob_to_regexp.d.ts +0 -0
  243. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/is_absolute.d.ts +0 -0
  244. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join.d.ts +0 -0
  245. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/join_globs.d.ts +0 -0
  246. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize.d.ts +0 -0
  247. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/normalize_glob.d.ts +0 -0
  248. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/parse.d.ts +0 -0
  249. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/resolve.d.ts +0 -0
  250. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_file_url.d.ts +0 -0
  251. /package/types/deps/jsr.io/@std/path/{1.1.3 → 1.1.4}/windows/to_namespaced_path.d.ts +0 -0
@@ -1,13 +1,13 @@
1
1
  // deno-lint-ignore-file no-explicit-any
2
2
  import * as dntShim from "../../../_dnt.shims.js";
3
- import { Command, colors, log, getPort, open, windmillUtils, yamlParseFile, SEP, } from "../../../deps.js";
3
+ import { colors, Command, getPort, log, open, SEP, windmillUtils, yamlParseFile, } from "../../../deps.js";
4
4
  import * as http from "node:http";
5
5
  import * as fs from "node:fs";
6
6
  import * as path from "node:path";
7
7
  import process from "node:process";
8
8
  import { writeFileSync } from "node:fs";
9
- import { WebSocketServer } from "ws";
10
- import { getDevBuildOptions, ensureNodeModules, createFrameworkPlugins, detectFrameworks, } from "./bundle.js";
9
+ import { WebSocket, WebSocketServer } from "ws";
10
+ import { createFrameworkPlugins, detectFrameworks, ensureNodeModules, getDevBuildOptions, } from "./bundle.js";
11
11
  import { wmillTsDev as wmillTs } from "./wmillTsDev.js";
12
12
  import * as wmill from "../../../gen/services.gen.js";
13
13
  import { resolveWorkspace } from "../../core/context.js";
@@ -16,9 +16,10 @@ import { GLOBAL_CONFIG_OPT } from "../../core/conf.js";
16
16
  import { replaceInlineScripts } from "./app.js";
17
17
  import { APP_BACKEND_FOLDER, inferRunnableSchemaFromFile, } from "./app_metadata.js";
18
18
  import { loadRunnablesFromBackend } from "./raw_apps.js";
19
+ import { regenerateAgentDocs } from "./generate_agents.js";
19
20
  const DEFAULT_PORT = 4000;
20
21
  const DEFAULT_HOST = "localhost";
21
- // HTML template with live reload
22
+ // HTML template with live reload and SQL migration modal
22
23
  const createHTML = (jsPath, cssPath) => `
23
24
  <!DOCTYPE html>
24
25
  <html lang="en">
@@ -43,10 +44,136 @@ const createHTML = (jsPath, cssPath) => `
43
44
  width: 100%;
44
45
  height: 100vh;
45
46
  }
47
+ /* SQL Migration Modal Styles */
48
+ .sql-modal-overlay {
49
+ display: none;
50
+ position: fixed;
51
+ top: 0;
52
+ left: 0;
53
+ width: 100%;
54
+ height: 100%;
55
+ background: rgba(0, 0, 0, 0.5);
56
+ z-index: 10000;
57
+ justify-content: center;
58
+ align-items: center;
59
+ }
60
+ .sql-modal-overlay.visible {
61
+ display: flex;
62
+ }
63
+ .sql-modal {
64
+ background: white;
65
+ border-radius: 8px;
66
+ max-width: 700px;
67
+ width: 90%;
68
+ max-height: 80vh;
69
+ display: flex;
70
+ flex-direction: column;
71
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
72
+ }
73
+ .sql-modal-header {
74
+ padding: 16px 20px;
75
+ border-bottom: 1px solid #e0e0e0;
76
+ display: flex;
77
+ justify-content: space-between;
78
+ align-items: center;
79
+ }
80
+ .sql-modal-header h2 {
81
+ margin: 0;
82
+ font-size: 18px;
83
+ color: #333;
84
+ }
85
+ .sql-modal-header .close-btn {
86
+ background: none;
87
+ border: none;
88
+ font-size: 24px;
89
+ cursor: pointer;
90
+ color: #666;
91
+ }
92
+ .sql-modal-body {
93
+ padding: 20px;
94
+ overflow-y: auto;
95
+ flex: 1;
96
+ }
97
+ .sql-modal-body p {
98
+ margin-bottom: 12px;
99
+ color: #555;
100
+ }
101
+ .sql-modal-body pre {
102
+ background: #f5f5f5;
103
+ padding: 12px;
104
+ border-radius: 4px;
105
+ overflow-x: auto;
106
+ font-size: 13px;
107
+ max-height: 300px;
108
+ overflow-y: auto;
109
+ }
110
+ .sql-modal-footer {
111
+ padding: 16px 20px;
112
+ border-top: 1px solid #e0e0e0;
113
+ display: flex;
114
+ justify-content: flex-end;
115
+ gap: 12px;
116
+ }
117
+ .sql-modal-footer button {
118
+ padding: 10px 20px;
119
+ border-radius: 4px;
120
+ cursor: pointer;
121
+ font-size: 14px;
122
+ }
123
+ .sql-modal-footer .cancel-btn {
124
+ background: #f0f0f0;
125
+ border: 1px solid #ccc;
126
+ color: #333;
127
+ }
128
+ .sql-modal-footer .apply-btn {
129
+ background: #3b82f6;
130
+ border: none;
131
+ color: white;
132
+ }
133
+ .sql-modal-footer .apply-btn:hover {
134
+ background: #2563eb;
135
+ }
136
+ .sql-modal-footer .apply-btn:disabled {
137
+ background: #9ca3af;
138
+ cursor: not-allowed;
139
+ }
140
+ .sql-result {
141
+ margin-top: 12px;
142
+ padding: 12px;
143
+ border-radius: 4px;
144
+ }
145
+ .sql-result.success {
146
+ background: #dcfce7;
147
+ color: #166534;
148
+ }
149
+ .sql-result.error {
150
+ background: #fee2e2;
151
+ color: #991b1b;
152
+ }
46
153
  </style>
47
154
  </head>
48
155
  <body>
49
156
  <div id="root"></div>
157
+ <!-- SQL Migration Modal -->
158
+ <div id="sql-modal-overlay" class="sql-modal-overlay">
159
+ <div class="sql-modal">
160
+ <div class="sql-modal-header">
161
+ <h2>Apply SQL Migration</h2>
162
+ <button class="close-btn" onclick="closeSqlModal()">&times;</button>
163
+ </div>
164
+ <div class="sql-modal-body">
165
+ <p><strong>File:</strong> <span id="sql-file-name"></span></p>
166
+ <p><strong>Datatable:</strong> <span id="sql-datatable"></span></p>
167
+ <p><strong>SQL to execute:</strong></p>
168
+ <pre id="sql-content"></pre>
169
+ <div id="sql-result"></div>
170
+ </div>
171
+ <div class="sql-modal-footer">
172
+ <button class="cancel-btn" onclick="closeSqlModal()">Cancel</button>
173
+ <button class="apply-btn" id="apply-sql-btn" onclick="applySql()">Apply SQL</button>
174
+ </div>
175
+ </div>
176
+ </div>
50
177
  <script src="${jsPath}"></script>
51
178
  <script>
52
179
  // Live reload via EventSource
@@ -58,6 +185,89 @@ const createHTML = (jsPath, cssPath) => `
58
185
  evtSource.addEventListener('error', () => {
59
186
  console.log('⚠️ Lost connection to dev server, retrying...');
60
187
  });
188
+
189
+ // SQL Migration Modal handling
190
+ let pendingSqlMigration = null;
191
+ let sqlWebSocket = null;
192
+
193
+ function initSqlWebSocket() {
194
+ const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
195
+ sqlWebSocket = new WebSocket(wsProtocol + '//' + location.host);
196
+
197
+ sqlWebSocket.onmessage = (event) => {
198
+ const data = JSON.parse(event.data);
199
+ if (data.type === 'sqlMigration') {
200
+ showSqlModal(data);
201
+ } else if (data.type === 'sqlMigrationResult') {
202
+ showSqlResult(data);
203
+ }
204
+ };
205
+
206
+ sqlWebSocket.onclose = () => {
207
+ // Reconnect after a delay
208
+ setTimeout(initSqlWebSocket, 1000);
209
+ };
210
+ }
211
+
212
+ function showSqlModal(data) {
213
+ pendingSqlMigration = data;
214
+ document.getElementById('sql-file-name').textContent = data.fileName;
215
+ document.getElementById('sql-datatable').textContent = data.datatable || 'Not configured';
216
+ document.getElementById('sql-content').textContent = data.sql;
217
+ document.getElementById('sql-result').innerHTML = '';
218
+ document.getElementById('apply-sql-btn').disabled = !data.datatable;
219
+ document.getElementById('sql-modal-overlay').classList.add('visible');
220
+ }
221
+
222
+ function closeSqlModal(skip = true) {
223
+ if (skip && pendingSqlMigration && sqlWebSocket) {
224
+ // Notify server that user skipped this file
225
+ sqlWebSocket.send(JSON.stringify({
226
+ type: 'skipSqlMigration',
227
+ fileName: pendingSqlMigration.fileName
228
+ }));
229
+ }
230
+ document.getElementById('sql-modal-overlay').classList.remove('visible');
231
+ pendingSqlMigration = null;
232
+ }
233
+
234
+ function applySql() {
235
+ if (!pendingSqlMigration || !sqlWebSocket) return;
236
+
237
+ document.getElementById('apply-sql-btn').disabled = true;
238
+ document.getElementById('apply-sql-btn').textContent = 'Applying...';
239
+
240
+ sqlWebSocket.send(JSON.stringify({
241
+ type: 'applySqlMigration',
242
+ fileName: pendingSqlMigration.fileName,
243
+ sql: pendingSqlMigration.sql,
244
+ datatable: pendingSqlMigration.datatable
245
+ }));
246
+ }
247
+
248
+ function showSqlResult(data) {
249
+ const resultDiv = document.getElementById('sql-result');
250
+ if (data.error) {
251
+ resultDiv.className = 'sql-result error';
252
+ resultDiv.innerHTML = '<strong>Error:</strong> ' + escapeHtml(data.message);
253
+ document.getElementById('apply-sql-btn').disabled = false;
254
+ document.getElementById('apply-sql-btn').textContent = 'Apply SQL';
255
+ } else {
256
+ resultDiv.className = 'sql-result success';
257
+ resultDiv.innerHTML = '<strong>Success!</strong> SQL applied and file deleted.';
258
+ // Auto-close after success (don't send skip since server already handled it)
259
+ setTimeout(() => closeSqlModal(false), 1500);
260
+ }
261
+ }
262
+
263
+ function escapeHtml(text) {
264
+ const div = document.createElement('div');
265
+ div.textContent = text;
266
+ return div.innerHTML;
267
+ }
268
+
269
+ // Initialize WebSocket for SQL migrations
270
+ initSqlWebSocket();
61
271
  </script>
62
272
  </body>
63
273
  </html>
@@ -97,7 +307,9 @@ async function dev(opts) {
97
307
  const shouldOpen = opts.open ?? true;
98
308
  // Detect frameworks to determine default entry point
99
309
  const frameworks = detectFrameworks(process.cwd());
100
- const defaultEntry = frameworks.svelte || frameworks.vue ? "index.ts" : "index.tsx";
310
+ const defaultEntry = frameworks.svelte || frameworks.vue
311
+ ? "index.ts"
312
+ : "index.tsx";
101
313
  const entryPoint = opts.entry ?? defaultEntry;
102
314
  // Verify entry point exists
103
315
  if (!fs.existsSync(entryPoint)) {
@@ -321,8 +533,128 @@ async function dev(opts) {
321
533
  });
322
534
  // Create WebSocket server on the same HTTP server
323
535
  const wss = new WebSocketServer({ server });
324
- wss.on("connection", (ws) => {
536
+ // SQL migration state (defined here so it's accessible in WebSocket handler)
537
+ const sqlToApplyPath = path.join(process.cwd(), "sql_to_apply");
538
+ const sqlFileQueue = [];
539
+ let currentSqlFile = null;
540
+ // Helper to read datatable from raw_app.yaml
541
+ async function getDatatableConfig() {
542
+ try {
543
+ const rawApp = (await yamlParseFile(path.join(process.cwd(), "raw_app.yaml")));
544
+ return rawApp?.data?.datatable;
545
+ }
546
+ catch {
547
+ return undefined;
548
+ }
549
+ }
550
+ // Helper to broadcast SQL migration notification to all WebSocket clients
551
+ function broadcastSqlMigration(fileName, sql, datatable) {
552
+ const message = JSON.stringify({
553
+ type: "sqlMigration",
554
+ fileName,
555
+ sql,
556
+ datatable,
557
+ });
558
+ wss.clients.forEach((client) => {
559
+ if (client.readyState === WebSocket.OPEN) {
560
+ client.send(message);
561
+ }
562
+ });
563
+ }
564
+ // Helper to add a SQL file to the queue (if not already queued)
565
+ function queueSqlFile(filePath) {
566
+ if (currentSqlFile === filePath) {
567
+ return; // Already being shown
568
+ }
569
+ if (sqlFileQueue.includes(filePath)) {
570
+ return; // Already in queue
571
+ }
572
+ sqlFileQueue.push(filePath);
573
+ }
574
+ // Helper to process the next SQL file in the queue
575
+ async function processNextSqlFile() {
576
+ if (currentSqlFile !== null) {
577
+ // Already showing a file, wait for it to be processed
578
+ return;
579
+ }
580
+ if (sqlFileQueue.length === 0) {
581
+ return;
582
+ }
583
+ const filePath = sqlFileQueue.shift();
584
+ // Check if file still exists (might have been deleted)
585
+ if (!fs.existsSync(filePath)) {
586
+ log.info(colors.gray(`File no longer exists: ${path.basename(filePath)}`));
587
+ // Try next file
588
+ await processNextSqlFile();
589
+ return;
590
+ }
591
+ currentSqlFile = filePath;
592
+ const fileName = path.basename(filePath);
593
+ try {
594
+ const sqlContent = await dntShim.Deno.readTextFile(filePath);
595
+ if (!sqlContent.trim()) {
596
+ log.info(colors.gray(`Skipping empty file: ${fileName}`));
597
+ currentSqlFile = null;
598
+ await processNextSqlFile();
599
+ return;
600
+ }
601
+ const datatable = await getDatatableConfig();
602
+ log.info(colors.magenta(`📋 SQL file ready: ${fileName} (datatable: ${datatable || "not configured"}) [${sqlFileQueue.length} more in queue]`));
603
+ broadcastSqlMigration(fileName, sqlContent, datatable);
604
+ }
605
+ catch (error) {
606
+ log.error(colors.red(`Error reading SQL file: ${error.message}`));
607
+ currentSqlFile = null;
608
+ await processNextSqlFile();
609
+ }
610
+ }
611
+ // Helper to handle SQL file completion (success or skip)
612
+ async function onSqlFileCompleted(filePath, deleteFile) {
613
+ if (deleteFile && fs.existsSync(filePath)) {
614
+ try {
615
+ fs.unlinkSync(filePath);
616
+ log.info(colors.green(`✓ Deleted: ${path.basename(filePath)}`));
617
+ }
618
+ catch (error) {
619
+ log.error(colors.red(`Failed to delete ${path.basename(filePath)}: ${error.message}`));
620
+ }
621
+ }
622
+ currentSqlFile = null;
623
+ // Process next file in queue
624
+ await processNextSqlFile();
625
+ }
626
+ wss.on("connection", async (ws) => {
325
627
  log.info(colors.cyan("[WebSocket] Client connected"));
628
+ // If there's a current SQL file being shown, send it to the new client
629
+ if (currentSqlFile && fs.existsSync(currentSqlFile)) {
630
+ try {
631
+ const sqlContent = await dntShim.Deno.readTextFile(currentSqlFile);
632
+ const datatable = await getDatatableConfig();
633
+ const fileName = path.basename(currentSqlFile);
634
+ ws.send(JSON.stringify({
635
+ type: "sqlMigration",
636
+ fileName,
637
+ sql: sqlContent,
638
+ datatable,
639
+ }));
640
+ log.info(colors.magenta(`📋 Sent pending SQL file to new client: ${fileName}`));
641
+ }
642
+ catch {
643
+ // File might have been deleted, ignore
644
+ }
645
+ }
646
+ else if (fs.existsSync(sqlToApplyPath)) {
647
+ // No current file, but check if there are files to process
648
+ const entries = fs.readdirSync(sqlToApplyPath);
649
+ const sqlFiles = entries.filter((entry) => entry.endsWith(".sql"));
650
+ if (sqlFiles.length > 0 && sqlFileQueue.length === 0) {
651
+ // Queue and process files
652
+ for (const sqlFile of sqlFiles.sort()) {
653
+ queueSqlFile(path.join(sqlToApplyPath, sqlFile));
654
+ }
655
+ await processNextSqlFile();
656
+ }
657
+ }
326
658
  ws.on("message", async (data) => {
327
659
  try {
328
660
  const message = JSON.parse(data.toString());
@@ -412,6 +744,72 @@ async function dev(opts) {
412
744
  }
413
745
  break;
414
746
  }
747
+ case "applySqlMigration": {
748
+ // Execute SQL migration against a datatable
749
+ const { sql, datatable, fileName } = message;
750
+ log.info(colors.blue(`[SQL Migration] Applying SQL from ${fileName} to datatable: ${datatable}`));
751
+ if (!datatable) {
752
+ ws.send(JSON.stringify({
753
+ type: "sqlMigrationResult",
754
+ error: true,
755
+ message: "No datatable configured. Set data.datatable in raw_app.yaml.",
756
+ }));
757
+ break;
758
+ }
759
+ try {
760
+ // Run SQL as a preview script against the datatable
761
+ const uuid = await wmill.runScriptPreview({
762
+ workspace: workspaceId,
763
+ requestBody: {
764
+ language: "postgresql",
765
+ content: sql,
766
+ args: { database: `datatable://${datatable}` },
767
+ },
768
+ });
769
+ log.info(colors.gray(`[SQL Migration] Job started: ${uuid}`));
770
+ // Wait for the result
771
+ const result = await waitForJob(workspaceId, uuid);
772
+ log.info(colors.green(`[SQL Migration] SQL applied successfully`));
773
+ ws.send(JSON.stringify({
774
+ type: "sqlMigrationResult",
775
+ error: false,
776
+ result,
777
+ }));
778
+ // Delete the SQL file and process next in queue
779
+ if (currentSqlFile) {
780
+ await onSqlFileCompleted(currentSqlFile, true);
781
+ }
782
+ // Regenerate AGENTS.md and DATATABLES.md to reflect schema changes
783
+ try {
784
+ await regenerateAgentDocs(workspaceId, process.cwd(), true);
785
+ log.info(colors.gray(`[SQL Migration] Refreshed AGENTS.md and DATATABLES.md`));
786
+ }
787
+ catch (regenError) {
788
+ log.warn(colors.yellow(`[SQL Migration] Could not refresh docs: ${regenError.message}`));
789
+ }
790
+ }
791
+ catch (error) {
792
+ log.error(colors.red(`[SQL Migration] Error: ${error.message}`));
793
+ ws.send(JSON.stringify({
794
+ type: "sqlMigrationResult",
795
+ error: true,
796
+ message: error.message || String(error),
797
+ }));
798
+ // Don't delete file on error, but clear current so user can retry
799
+ currentSqlFile = null;
800
+ }
801
+ break;
802
+ }
803
+ case "skipSqlMigration": {
804
+ // User chose to skip this SQL file
805
+ const { fileName } = message;
806
+ log.info(colors.yellow(`[SQL Migration] Skipped: ${fileName}`));
807
+ // Don't delete file, just move to next
808
+ if (currentSqlFile) {
809
+ await onSqlFileCompleted(currentSqlFile, false);
810
+ }
811
+ break;
812
+ }
415
813
  default:
416
814
  log.warn(colors.yellow(`[WebSocket] Unknown message type: ${type}`));
417
815
  respond("error", { message: `Unknown message type: ${type}` }, true);
@@ -428,6 +826,82 @@ async function dev(opts) {
428
826
  log.error(colors.red(`[WebSocket] Error: ${error.message}`));
429
827
  });
430
828
  });
829
+ // Watch sql_to_apply folder for SQL migration files
830
+ let sqlWatcher;
831
+ // Helper to scan for existing SQL files and add them to the queue
832
+ async function scanExistingSqlFiles() {
833
+ if (!fs.existsSync(sqlToApplyPath)) {
834
+ return;
835
+ }
836
+ try {
837
+ const entries = fs.readdirSync(sqlToApplyPath);
838
+ const sqlFiles = entries
839
+ .filter((entry) => entry.endsWith(".sql"))
840
+ .sort(); // Sort alphabetically to process in order
841
+ if (sqlFiles.length === 0) {
842
+ return;
843
+ }
844
+ log.info(colors.blue(`🔍 Found ${sqlFiles.length} SQL file(s) in sql_to_apply/`));
845
+ // Add each SQL file to the queue
846
+ for (const sqlFile of sqlFiles) {
847
+ const filePath = path.join(sqlToApplyPath, sqlFile);
848
+ queueSqlFile(filePath);
849
+ }
850
+ // Start processing the queue
851
+ await processNextSqlFile();
852
+ }
853
+ catch (error) {
854
+ log.error(colors.red(`Error scanning sql_to_apply folder: ${error.message}`));
855
+ }
856
+ }
857
+ if (fs.existsSync(sqlToApplyPath)) {
858
+ log.info(colors.blue(`🗃️ Watching sql_to_apply folder at: ${sqlToApplyPath}\n`));
859
+ sqlWatcher = dntShim.Deno.watchFs(sqlToApplyPath);
860
+ // Debounce timeout for SQL file changes
861
+ const sqlDebounceTimeouts = {};
862
+ const SQL_DEBOUNCE_MS = 300;
863
+ // Handle SQL file changes in the background
864
+ (async () => {
865
+ try {
866
+ for await (const event of sqlWatcher) {
867
+ for (const changedPath of event.paths) {
868
+ // Only handle .sql files
869
+ if (!changedPath.endsWith(".sql")) {
870
+ continue;
871
+ }
872
+ // Only handle modify and create events
873
+ if (event.kind !== "modify" && event.kind !== "create") {
874
+ continue;
875
+ }
876
+ const fileName = path.basename(changedPath);
877
+ // Debounce per file
878
+ if (sqlDebounceTimeouts[changedPath]) {
879
+ clearTimeout(sqlDebounceTimeouts[changedPath]);
880
+ }
881
+ sqlDebounceTimeouts[changedPath] = setTimeout(async () => {
882
+ delete sqlDebounceTimeouts[changedPath];
883
+ log.info(colors.cyan(`📋 SQL file detected: ${fileName}`));
884
+ // Add to queue and process
885
+ queueSqlFile(changedPath);
886
+ await processNextSqlFile();
887
+ }, SQL_DEBOUNCE_MS);
888
+ }
889
+ }
890
+ }
891
+ catch (error) {
892
+ if (error.name !== "Interrupted") {
893
+ log.error(colors.red(`Error watching sql_to_apply: ${error.message}`));
894
+ }
895
+ }
896
+ })();
897
+ // Scan for existing SQL files after a delay (to let WebSocket clients connect)
898
+ setTimeout(() => {
899
+ scanExistingSqlFiles();
900
+ }, 2000);
901
+ }
902
+ else {
903
+ log.info(colors.gray("ℹ️ No sql_to_apply folder found (will not watch for SQL migrations)\n"));
904
+ }
431
905
  server.listen(port, host, () => {
432
906
  const url = `http://${host}:${port}`;
433
907
  log.info(colors.bold.green(`🚀 Dev server running at ${url}`));
@@ -458,6 +932,10 @@ async function dev(opts) {
458
932
  if (runnablesWatcher) {
459
933
  runnablesWatcher.close();
460
934
  }
935
+ // Close SQL watcher if it exists
936
+ if (sqlWatcher) {
937
+ sqlWatcher.close();
938
+ }
461
939
  await ctx.dispose();
462
940
  process.exit(0);
463
941
  });
@@ -535,7 +1013,7 @@ async function loadRunnables() {
535
1013
  async function executeRunnable(runnable, workspace, appPath, runnableId, args) {
536
1014
  const requestBody = {
537
1015
  component: runnableId,
538
- args,
1016
+ args: args ?? {},
539
1017
  force_viewer_static_fields: {},
540
1018
  force_viewer_one_of_fields: {},
541
1019
  force_viewer_allow_user_resources: [],
@@ -568,10 +1046,9 @@ async function executeRunnable(runnable, workspace, appPath, runnableId, args) {
568
1046
  else if (runnable.type === "path" && runnable.runType && runnable.path) {
569
1047
  // Path-based runnables have type: "path" and runType: "script"|"hubscript"|"flow"
570
1048
  const prefix = runnable.runType;
571
- requestBody.path =
572
- prefix !== "hubscript"
573
- ? `${prefix}/${runnable.path}`
574
- : `script/${runnable.path}`;
1049
+ requestBody.path = prefix !== "hubscript"
1050
+ ? `${prefix}/${runnable.path}`
1051
+ : `script/${runnable.path}`;
575
1052
  }
576
1053
  const uuid = await wmill.executeComponent({
577
1054
  workspace,