@superblocksteam/vite-plugin-file-sync 2.0.74 → 2.0.75-next.3

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 (339) hide show
  1. package/dist/ai-service/agent/middleware.d.ts +14 -0
  2. package/dist/ai-service/agent/middleware.d.ts.map +1 -1
  3. package/dist/ai-service/agent/middleware.js +40 -0
  4. package/dist/ai-service/agent/middleware.js.map +1 -1
  5. package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
  6. package/dist/ai-service/agent/prompts/build-base-system-prompt.js +66 -5
  7. package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
  8. package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -1
  9. package/dist/ai-service/agent/subagents/apis/static-analysis.js +11 -5
  10. package/dist/ai-service/agent/subagents/apis/static-analysis.js.map +1 -1
  11. package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts.map +1 -1
  12. package/dist/ai-service/agent/subagents/testing/prompt-builder.js +15 -0
  13. package/dist/ai-service/agent/subagents/testing/prompt-builder.js.map +1 -1
  14. package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
  15. package/dist/ai-service/agent/tool-message-utils.js +3 -0
  16. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  17. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
  18. package/dist/ai-service/agent/tools/apis/build-api-artifact.js +11 -3
  19. package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -1
  20. package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
  21. package/dist/ai-service/agent/tools/apis/build-api.js +6 -0
  22. package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
  23. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -1
  24. package/dist/ai-service/agent/tools/apis/get-api-docs.js +99 -3
  25. package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -1
  26. package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -1
  27. package/dist/ai-service/agent/tools/apis/integration-types.js +69 -17
  28. package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -1
  29. package/dist/ai-service/agent/tools/apis/test-api.d.ts +1 -1
  30. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/test-api.js +26 -45
  32. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/write-api.d.ts +2 -2
  34. package/dist/ai-service/agent/tools/apis/write-api.d.ts.map +1 -1
  35. package/dist/ai-service/agent/tools/apis/write-api.js +8 -2
  36. package/dist/ai-service/agent/tools/apis/write-api.js.map +1 -1
  37. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  38. package/dist/ai-service/agent/tools/build-capture-screenshot.js +3 -0
  39. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  40. package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
  41. package/dist/ai-service/agent/tools/build-debug.js +58 -6
  42. package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
  43. package/dist/ai-service/agent/tools/build-delete-file.d.ts +1 -1
  44. package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/build-delete-file.js +27 -196
  46. package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -1
  47. package/dist/ai-service/agent/tools/build-edit-file.d.ts +1 -1
  48. package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-edit-file.js +12 -22
  50. package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  52. package/dist/ai-service/agent/tools/build-finalize.js +3 -0
  53. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  54. package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
  55. package/dist/ai-service/agent/tools/build-install-packages.js +15 -0
  56. package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
  57. package/dist/ai-service/agent/tools/build-list-files.d.ts +1 -1
  58. package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -1
  59. package/dist/ai-service/agent/tools/build-list-files.js +6 -14
  60. package/dist/ai-service/agent/tools/build-list-files.js.map +1 -1
  61. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  62. package/dist/ai-service/agent/tools/build-manage-checklist.js +9 -0
  63. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  64. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +2 -2
  65. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
  66. package/dist/ai-service/agent/tools/build-multi-edit-file.js +8 -25
  67. package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
  68. package/dist/ai-service/agent/tools/build-read-file.d.ts +10 -4
  69. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/build-read-file.js +75 -77
  71. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  72. package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -1
  73. package/dist/ai-service/agent/tools/build-reload-file.js +5 -0
  74. package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -1
  75. package/dist/ai-service/agent/tools/build-rename-file.d.ts +1 -1
  76. package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -1
  77. package/dist/ai-service/agent/tools/build-rename-file.js +3 -50
  78. package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -1
  79. package/dist/ai-service/agent/tools/build-validate-icons.d.ts.map +1 -1
  80. package/dist/ai-service/agent/tools/build-validate-icons.js +8 -0
  81. package/dist/ai-service/agent/tools/build-validate-icons.js.map +1 -1
  82. package/dist/ai-service/agent/tools/build-write-file.d.ts +2 -2
  83. package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
  84. package/dist/ai-service/agent/tools/build-write-file.js +7 -17
  85. package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
  86. package/dist/ai-service/agent/tools/clear-error-cache.d.ts +10 -0
  87. package/dist/ai-service/agent/tools/clear-error-cache.d.ts.map +1 -0
  88. package/dist/ai-service/agent/tools/clear-error-cache.js +38 -0
  89. package/dist/ai-service/agent/tools/clear-error-cache.js.map +1 -0
  90. package/dist/ai-service/agent/tools/get-console-logs.d.ts.map +1 -1
  91. package/dist/ai-service/agent/tools/get-console-logs.js +6 -0
  92. package/dist/ai-service/agent/tools/get-console-logs.js.map +1 -1
  93. package/dist/ai-service/agent/tools/get-runtime-errors.d.ts.map +1 -1
  94. package/dist/ai-service/agent/tools/get-runtime-errors.js +4 -0
  95. package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -1
  96. package/dist/ai-service/agent/tools/index.d.ts +1 -0
  97. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  98. package/dist/ai-service/agent/tools/index.js +1 -0
  99. package/dist/ai-service/agent/tools/index.js.map +1 -1
  100. package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
  101. package/dist/ai-service/agent/tools/integrations/execute-request.js +56 -9
  102. package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
  103. package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
  104. package/dist/ai-service/agent/tools/integrations/metadata.js +6 -0
  105. package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
  106. package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -1
  107. package/dist/ai-service/agent/tools/integrations/run-code.js +9 -0
  108. package/dist/ai-service/agent/tools/integrations/run-code.js.map +1 -1
  109. package/dist/ai-service/agent/tools.d.ts.map +1 -1
  110. package/dist/ai-service/agent/tools.js +27 -6
  111. package/dist/ai-service/agent/tools.js.map +1 -1
  112. package/dist/ai-service/agent/tools2/registry.d.ts +15 -0
  113. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  114. package/dist/ai-service/agent/tools2/registry.js +30 -0
  115. package/dist/ai-service/agent/tools2/registry.js.map +1 -1
  116. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
  117. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +11 -1
  118. package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
  119. package/dist/ai-service/agent/tools2/tools/edit.d.ts +4 -1
  120. package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -1
  121. package/dist/ai-service/agent/tools2/tools/edit.js +10 -8
  122. package/dist/ai-service/agent/tools2/tools/edit.js.map +1 -1
  123. package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts.map +1 -1
  124. package/dist/ai-service/agent/tools2/tools/end-test-run.js +5 -0
  125. package/dist/ai-service/agent/tools2/tools/end-test-run.js.map +1 -1
  126. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +2 -0
  127. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
  128. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +24 -0
  129. package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
  130. package/dist/ai-service/agent/tools2/tools/glob.d.ts +4 -1
  131. package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -1
  132. package/dist/ai-service/agent/tools2/tools/glob.js +25 -85
  133. package/dist/ai-service/agent/tools2/tools/glob.js.map +1 -1
  134. package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
  135. package/dist/ai-service/agent/tools2/tools/grep-metadata.js +9 -0
  136. package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
  137. package/dist/ai-service/agent/tools2/tools/grep.d.ts +1 -1
  138. package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
  139. package/dist/ai-service/agent/tools2/tools/grep.js +22 -5
  140. package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
  141. package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
  142. package/dist/ai-service/agent/tools2/tools/list-attachments.js +4 -0
  143. package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
  144. package/dist/ai-service/agent/tools2/tools/ls.d.ts +8 -1
  145. package/dist/ai-service/agent/tools2/tools/ls.d.ts.map +1 -1
  146. package/dist/ai-service/agent/tools2/tools/ls.js +102 -83
  147. package/dist/ai-service/agent/tools2/tools/ls.js.map +1 -1
  148. package/dist/ai-service/agent/tools2/tools/read.d.ts +5 -2
  149. package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -1
  150. package/dist/ai-service/agent/tools2/tools/read.js +24 -12
  151. package/dist/ai-service/agent/tools2/tools/read.js.map +1 -1
  152. package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts.map +1 -1
  153. package/dist/ai-service/agent/tools2/tools/start-test-run.js +13 -0
  154. package/dist/ai-service/agent/tools2/tools/start-test-run.js.map +1 -1
  155. package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts.map +1 -1
  156. package/dist/ai-service/agent/tools2/tools/update-test-case-status.js +6 -0
  157. package/dist/ai-service/agent/tools2/tools/update-test-case-status.js.map +1 -1
  158. package/dist/ai-service/agent/tools2/tools/write.d.ts +4 -1
  159. package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -1
  160. package/dist/ai-service/agent/tools2/tools/write.js +9 -4
  161. package/dist/ai-service/agent/tools2/tools/write.js.map +1 -1
  162. package/dist/ai-service/agent/tools2/types.d.ts +25 -0
  163. package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
  164. package/dist/ai-service/agent/tools2/types.js.map +1 -1
  165. package/dist/ai-service/app-interface/constants.d.ts +77 -0
  166. package/dist/ai-service/app-interface/constants.d.ts.map +1 -0
  167. package/dist/ai-service/app-interface/constants.js +129 -0
  168. package/dist/ai-service/app-interface/constants.js.map +1 -0
  169. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +87 -0
  170. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -0
  171. package/dist/ai-service/app-interface/filesystem/draft-manager.js +91 -0
  172. package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -0
  173. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts +35 -0
  174. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +1 -0
  175. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js +236 -0
  176. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js.map +1 -0
  177. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts +5 -0
  178. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts.map +1 -0
  179. package/dist/ai-service/app-interface/filesystem/handlers/index.js +5 -0
  180. package/dist/ai-service/app-interface/filesystem/handlers/index.js.map +1 -0
  181. package/dist/ai-service/app-interface/filesystem/index.d.ts +12 -0
  182. package/dist/ai-service/app-interface/filesystem/index.d.ts.map +1 -0
  183. package/dist/ai-service/app-interface/filesystem/index.js +11 -0
  184. package/dist/ai-service/app-interface/filesystem/index.js.map +1 -0
  185. package/dist/ai-service/app-interface/filesystem/validation.d.ts +71 -0
  186. package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +1 -0
  187. package/dist/ai-service/app-interface/filesystem/validation.js +170 -0
  188. package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -0
  189. package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +108 -0
  190. package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -0
  191. package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +157 -0
  192. package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -0
  193. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts +126 -0
  194. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts.map +1 -0
  195. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js +9 -0
  196. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js.map +1 -0
  197. package/dist/ai-service/app-interface/linter.d.ts +4 -1
  198. package/dist/ai-service/app-interface/linter.d.ts.map +1 -1
  199. package/dist/ai-service/app-interface/linter.js +10 -6
  200. package/dist/ai-service/app-interface/linter.js.map +1 -1
  201. package/dist/ai-service/app-interface/shell.d.ts +205 -1
  202. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  203. package/dist/ai-service/app-interface/shell.js +474 -14
  204. package/dist/ai-service/app-interface/shell.js.map +1 -1
  205. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  206. package/dist/ai-service/chat/chat-session-store.js +8 -0
  207. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  208. package/dist/ai-service/features.d.ts +8 -0
  209. package/dist/ai-service/features.d.ts.map +1 -1
  210. package/dist/ai-service/features.js +8 -0
  211. package/dist/ai-service/features.js.map +1 -1
  212. package/dist/ai-service/index.d.ts +1 -1
  213. package/dist/ai-service/index.d.ts.map +1 -1
  214. package/dist/ai-service/index.js +26 -24
  215. package/dist/ai-service/index.js.map +1 -1
  216. package/dist/ai-service/judge/judge-executor.d.ts.map +1 -1
  217. package/dist/ai-service/judge/judge-executor.js +4 -0
  218. package/dist/ai-service/judge/judge-executor.js.map +1 -1
  219. package/dist/ai-service/llm/client.d.ts +19 -3
  220. package/dist/ai-service/llm/client.d.ts.map +1 -1
  221. package/dist/ai-service/llm/client.js +131 -12
  222. package/dist/ai-service/llm/client.js.map +1 -1
  223. package/dist/ai-service/llm/context/context.d.ts +4 -1
  224. package/dist/ai-service/llm/context/context.d.ts.map +1 -1
  225. package/dist/ai-service/llm/context/context.js +27 -5
  226. package/dist/ai-service/llm/context/context.js.map +1 -1
  227. package/dist/ai-service/llm/context/internal-types.d.ts +5 -0
  228. package/dist/ai-service/llm/context/internal-types.d.ts.map +1 -1
  229. package/dist/ai-service/llm/context/internal-types.js +5 -0
  230. package/dist/ai-service/llm/context/internal-types.js.map +1 -1
  231. package/dist/ai-service/llm/context/levels/l1.d.ts +4 -3
  232. package/dist/ai-service/llm/context/levels/l1.d.ts.map +1 -1
  233. package/dist/ai-service/llm/context/levels/l1.js +9 -8
  234. package/dist/ai-service/llm/context/levels/l1.js.map +1 -1
  235. package/dist/ai-service/llm/context/serialization.d.ts +8 -0
  236. package/dist/ai-service/llm/context/serialization.d.ts.map +1 -1
  237. package/dist/ai-service/llm/context/utils/content-compaction.d.ts +7 -5
  238. package/dist/ai-service/llm/context/utils/content-compaction.d.ts.map +1 -1
  239. package/dist/ai-service/llm/context/utils/content-compaction.js +27 -6
  240. package/dist/ai-service/llm/context/utils/content-compaction.js.map +1 -1
  241. package/dist/ai-service/llm/error.d.ts +1 -0
  242. package/dist/ai-service/llm/error.d.ts.map +1 -1
  243. package/dist/ai-service/llm/error.js +29 -3
  244. package/dist/ai-service/llm/error.js.map +1 -1
  245. package/dist/ai-service/llm/stream/config.d.ts +14 -5
  246. package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
  247. package/dist/ai-service/llm/stream/config.js +17 -5
  248. package/dist/ai-service/llm/stream/config.js.map +1 -1
  249. package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
  250. package/dist/ai-service/llm/stream/errors.js +7 -4
  251. package/dist/ai-service/llm/stream/errors.js.map +1 -1
  252. package/dist/ai-service/llm/stream/index.d.ts +4 -2
  253. package/dist/ai-service/llm/stream/index.d.ts.map +1 -1
  254. package/dist/ai-service/llm/stream/index.js +4 -2
  255. package/dist/ai-service/llm/stream/index.js.map +1 -1
  256. package/dist/ai-service/llm/stream/orchestrator.d.ts +1 -1
  257. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  258. package/dist/ai-service/llm/stream/orchestrator.js +5 -11
  259. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  260. package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
  261. package/dist/ai-service/llm/stream/retry-engine.js +3 -3
  262. package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
  263. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts +8 -0
  264. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -1
  265. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js +108 -0
  266. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -1
  267. package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -1
  268. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +360 -133
  269. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
  270. package/dist/ai-service/security/index.d.ts +8 -0
  271. package/dist/ai-service/security/index.d.ts.map +1 -0
  272. package/dist/ai-service/security/index.js +8 -0
  273. package/dist/ai-service/security/index.js.map +1 -0
  274. package/dist/ai-service/security/safety-classifier.d.ts +103 -0
  275. package/dist/ai-service/security/safety-classifier.d.ts.map +1 -0
  276. package/dist/ai-service/security/safety-classifier.js +168 -0
  277. package/dist/ai-service/security/safety-classifier.js.map +1 -0
  278. package/dist/ai-service/security/secret-scanner.d.ts +145 -0
  279. package/dist/ai-service/security/secret-scanner.d.ts.map +1 -0
  280. package/dist/ai-service/security/secret-scanner.js +344 -0
  281. package/dist/ai-service/security/secret-scanner.js.map +1 -0
  282. package/dist/ai-service/state-machine/clark-fsm.d.ts +2 -1
  283. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  284. package/dist/ai-service/state-machine/clark-fsm.js +29 -8
  285. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  286. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  287. package/dist/ai-service/state-machine/handlers/agent-planning.js +17 -6
  288. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  289. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  290. package/dist/ai-service/state-machine/handlers/llm-generating.js +9 -1
  291. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  292. package/dist/ai-service/template-renderer.d.ts.map +1 -1
  293. package/dist/ai-service/template-renderer.js +4 -1
  294. package/dist/ai-service/template-renderer.js.map +1 -1
  295. package/dist/ai-service/transform/api-builder/shared.js +2 -2
  296. package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
  297. package/dist/components-manager.d.ts.map +1 -1
  298. package/dist/components-manager.js +17 -12
  299. package/dist/components-manager.js.map +1 -1
  300. package/dist/ensure-app-provider.d.ts +2 -0
  301. package/dist/ensure-app-provider.d.ts.map +1 -0
  302. package/dist/ensure-app-provider.js +209 -0
  303. package/dist/ensure-app-provider.js.map +1 -0
  304. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  305. package/dist/file-sync-vite-plugin.js +22 -12
  306. package/dist/file-sync-vite-plugin.js.map +1 -1
  307. package/dist/file-system-manager.d.ts +0 -6
  308. package/dist/file-system-manager.d.ts.map +1 -1
  309. package/dist/file-system-manager.js +119 -144
  310. package/dist/file-system-manager.js.map +1 -1
  311. package/dist/parsing/util.d.ts.map +1 -1
  312. package/dist/parsing/util.js +5 -1
  313. package/dist/parsing/util.js.map +1 -1
  314. package/dist/socket-manager.d.ts.map +1 -1
  315. package/dist/socket-manager.js +5 -0
  316. package/dist/socket-manager.js.map +1 -1
  317. package/dist/source-tracker.d.ts +4 -0
  318. package/dist/source-tracker.d.ts.map +1 -1
  319. package/dist/source-tracker.js +15 -8
  320. package/dist/source-tracker.js.map +1 -1
  321. package/dist/sync-service/index.d.ts.map +1 -1
  322. package/dist/sync-service/index.js +13 -8
  323. package/dist/sync-service/index.js.map +1 -1
  324. package/dist/util/logger.d.ts.map +1 -1
  325. package/dist/util/logger.js +16 -0
  326. package/dist/util/logger.js.map +1 -1
  327. package/dist/util.d.ts +1 -1
  328. package/dist/util.d.ts.map +1 -1
  329. package/dist/util.js +4 -2
  330. package/dist/util.js.map +1 -1
  331. package/package.json +10 -16
  332. package/dist/ai-service/agent/tools/apis/api-source.d.ts +0 -24
  333. package/dist/ai-service/agent/tools/apis/api-source.d.ts.map +0 -1
  334. package/dist/ai-service/agent/tools/apis/api-source.js +0 -108
  335. package/dist/ai-service/agent/tools/apis/api-source.js.map +0 -1
  336. package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts +0 -7
  337. package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts.map +0 -1
  338. package/dist/ai-service/state-machine/helpers/file-read-tracker.js +0 -26
  339. package/dist/ai-service/state-machine/helpers/file-read-tracker.js.map +0 -1
@@ -1,15 +1,13 @@
1
1
  import fs from "fs/promises";
2
- import path from "node:path";
2
+ import nodePath from "node:path";
3
3
  import * as t from "@babel/types";
4
4
  import { PROCESSED_TRANSACTIONS_ATTRIBUTE, ROOT_WIDGET_ATTRIBUTE, SOURCE_ID_ATTRIBUTE, WIDGET_DISABLE_DND, } from "@superblocksteam/library-shared";
5
5
  import { addTracingToMethods, TracedEventEmitter, } from "@superblocksteam/shared";
6
6
  import { readAppApiYamlFile, writeApiFiles, } from "@superblocksteam/util";
7
7
  import { glob } from "glob";
8
8
  import { isEqual, debounce } from "lodash-es";
9
+ import { normalizePath } from "vite";
9
10
  import yaml from "yaml";
10
- import { Paths } from "./ai-service/const.js";
11
- import { YamlToApiBuilderTransformer } from "./ai-service/transform/api-builder/to-sdk-transformer.js";
12
- import { applyFileTransformations, renderPath, } from "./ai-service/transform/shared.js";
13
11
  import { generateJSXAttribute } from "./codegen.js";
14
12
  import { ComponentsManager } from "./components-manager.js";
15
13
  import { addLegacyCustomComponentVariables, modifyLegacyCustomComponentElements, modifyLegacyCustomComponentImports, } from "./custom-components.js";
@@ -116,13 +114,13 @@ export class FileSystemManager extends TracedEventEmitter {
116
114
  if (!this.rootDir) {
117
115
  throw new Error("Root directory not set");
118
116
  }
119
- return path.join(this.rootDir, "App.tsx");
117
+ return nodePath.join(this.rootDir, "App.tsx");
120
118
  }
121
119
  get rootScopeFilePath() {
122
120
  if (!this.rootDir) {
123
121
  throw new Error("Root directory not set");
124
122
  }
125
- return path.join(this.rootDir, SCOPE_FILE);
123
+ return nodePath.join(this.rootDir, SCOPE_FILE);
126
124
  }
127
125
  // MARK: core setup/init
128
126
  async watch(watcher, rootPath) {
@@ -130,7 +128,7 @@ export class FileSystemManager extends TracedEventEmitter {
130
128
  this.rootDir = rootPath;
131
129
  this.watcher = watcher;
132
130
  // APIs and pages are in the pages subfolder
133
- const fileNames = await readFiles(path.join(rootPath));
131
+ const fileNames = await readFiles(nodePath.join(rootPath));
134
132
  // this reads all files excluding ignore list in the root path. Should we read all files in pages and add root.tsx and App.tsx instead?
135
133
  const tsxFiles = fileNames.filter((f) => f.endsWith(".tsx") && !f.includes(`${getLegacyComponentsFolder()}/`));
136
134
  const yamlFiles = fileNames.filter((f) => f.endsWith(".yaml"));
@@ -168,7 +166,7 @@ export class FileSystemManager extends TracedEventEmitter {
168
166
  // We only want to load the typescript files here, before the source tracker is initialized
169
167
  // API setup needs to be deferred until we've parsed the scope files (which is done in the source tracker)
170
168
  if (type === "tsx" || type === "ts") {
171
- this.tsFiles[path] = content;
169
+ this.tsFiles[normalizePath(path)] = content;
172
170
  }
173
171
  });
174
172
  try {
@@ -287,21 +285,22 @@ export class FileSystemManager extends TracedEventEmitter {
287
285
  if (!this.sourceTracker) {
288
286
  throw new Error("Source tracker not initialized");
289
287
  }
288
+ const normalizedPath = normalizePath(filePath);
290
289
  const files = this.sourceTracker.getCurrentFiles();
291
- if (!files[filePath]) {
292
- throw new Error("File not found in source tracker " + filePath);
290
+ if (!files[normalizedPath]) {
291
+ throw new Error("File not found in source tracker " + normalizedPath);
293
292
  }
294
- let ast = files[filePath].ast;
293
+ let ast = files[normalizedPath].ast;
295
294
  if (!ast) {
296
- throw new Error("No AST found for file in source tracker " + filePath);
295
+ throw new Error("No AST found for file in source tracker " + normalizedPath);
297
296
  }
298
- if (filePath in this.tsFiles &&
299
- this.tsFiles[filePath] &&
300
- files[filePath].code !== this.tsFiles[filePath]) {
297
+ if (normalizedPath in this.tsFiles &&
298
+ this.tsFiles[normalizedPath] &&
299
+ files[normalizedPath].code !== this.tsFiles[normalizedPath]) {
301
300
  getLogger().error("File code mismatch in source tracker, this should never happen: " +
302
301
  filePath);
303
- await this.handleNonVisualChangeByDeletingIds(filePath, this.tsFiles[filePath]);
304
- const newAst = this.sourceTracker.getCurrentFiles()[filePath]?.ast;
302
+ await this.handleNonVisualChangeByDeletingIds(filePath, this.tsFiles[normalizedPath]);
303
+ const newAst = this.sourceTracker.getCurrentFiles()[normalizedPath]?.ast;
305
304
  if (!newAst) {
306
305
  throw new Error("No AST found for file in source tracker after mismatch:" + filePath);
307
306
  }
@@ -456,46 +455,49 @@ export class FileSystemManager extends TracedEventEmitter {
456
455
  return;
457
456
  }
458
457
  const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
458
+ // Normalize both paths for comparison (Windows compatibility)
459
+ const normalizedFilePath = normalizePath(filePath);
460
+ const normalizedRootPath = normalizePath(rootPath);
459
461
  // Only handle files we care about and that are in our root path
460
- if (!fileType || !filePath.startsWith(rootPath)) {
462
+ if (!fileType || !normalizedFilePath.startsWith(normalizedRootPath)) {
461
463
  return;
462
464
  }
463
465
  // Queue the operation based on the event type
464
466
  switch (event) {
465
467
  case "add": {
466
- const file = await readFile(filePath);
468
+ const file = await readFile(normalizedFilePath);
467
469
  if (typeof file !== "string")
468
470
  return;
469
471
  switch (fileType.type) {
470
472
  case "api":
471
473
  case "python-api-step":
472
474
  case "js-api-step": {
473
- await this.processApiFileUpdates(filePath, fileType);
475
+ await this.processApiFileUpdates(normalizedFilePath, fileType);
474
476
  break;
475
477
  }
476
478
  case "ts":
477
479
  case "tsx":
478
- if (!(filePath in this.tsFiles)) {
479
- this.tsFiles[filePath] = file;
480
- await this.handleNonVisualChangeByDeletingIds(filePath, file);
481
- this.emit("fileChanged", filePath, file, true);
480
+ if (!(normalizedFilePath in this.tsFiles)) {
481
+ this.tsFiles[normalizedFilePath] = file;
482
+ await this.handleNonVisualChangeByDeletingIds(normalizedFilePath, file);
483
+ this.emit("fileChanged", normalizedFilePath, file, true);
482
484
  return;
483
485
  }
484
486
  }
485
487
  break;
486
488
  }
487
489
  case "change": {
488
- const fileType = SUPPORTED_FILETYPES.find((f) => filePath.endsWith(f.extension));
489
- if (!fileType || !filePath.startsWith(rootPath)) {
490
+ const fileType = SUPPORTED_FILETYPES.find((f) => normalizedFilePath.endsWith(f.extension));
491
+ if (!fileType || !normalizedFilePath.startsWith(rootPath)) {
490
492
  return;
491
493
  }
492
- const data = await readFile(filePath);
494
+ const data = await readFile(normalizedFilePath);
493
495
  if (typeof data !== "string")
494
496
  return;
495
497
  // Handle router file changes
496
- if (this.routerFilePath && filePath === this.routerFilePath) {
498
+ if (this.routerFilePath && normalizedFilePath === this.routerFilePath) {
497
499
  logger.info("Router file changed, emitting routerChange event");
498
- this.emit("routerChange", filePath);
500
+ this.emit("routerChange", normalizedFilePath);
499
501
  return;
500
502
  }
501
503
  switch (fileType.type) {
@@ -503,17 +505,18 @@ export class FileSystemManager extends TracedEventEmitter {
503
505
  case "tsx":
504
506
  case "scope":
505
507
  {
506
- if (!(filePath in this.tsFiles && this.tsFiles[filePath] === data)) {
507
- logger.info(`File changed: ${filePath} updating AST tracker`);
508
- this.tsFiles[filePath] = data;
508
+ if (!(normalizedFilePath in this.tsFiles &&
509
+ this.tsFiles[normalizedFilePath] === data)) {
510
+ logger.info(`File changed: ${normalizedFilePath} updating AST tracker`);
511
+ this.tsFiles[normalizedFilePath] = data;
509
512
  // only update the source tracker if the file is different
510
- await this.handleNonVisualChangeByDeletingIds(filePath, data);
511
- this.emit("fileChanged", filePath, data, true);
513
+ await this.handleNonVisualChangeByDeletingIds(normalizedFilePath, data);
514
+ this.emit("fileChanged", normalizedFilePath, data, true);
512
515
  }
513
516
  else {
514
- logger.info(`File unchanged from last tracked state: ${filePath}`);
515
- this.emit("fileChanged", filePath, data, false);
516
- this.sourceTracker?.updateFileContents(filePath, data);
517
+ logger.info(`File unchanged from last tracked state: ${normalizedFilePath}`);
518
+ this.emit("fileChanged", normalizedFilePath, data, false);
519
+ this.sourceTracker?.updateFileContents(normalizedFilePath, data);
517
520
  }
518
521
  }
519
522
  break;
@@ -521,16 +524,17 @@ export class FileSystemManager extends TracedEventEmitter {
521
524
  case "python-api-step":
522
525
  case "js-api-step":
523
526
  {
524
- await this.processApiFileUpdates(filePath, fileType);
527
+ await this.processApiFileUpdates(normalizedFilePath, fileType);
525
528
  }
526
529
  break;
527
530
  }
528
531
  break;
529
532
  }
530
533
  case "unlink": {
531
- if (filePath in this.tsFiles) {
532
- await this.deleteTsFile(filePath);
533
- if (this.routerFilePath && filePath === this.routerFilePath) {
534
+ if (normalizedFilePath in this.tsFiles) {
535
+ await this.deleteTsFile(normalizedFilePath);
536
+ if (this.routerFilePath &&
537
+ normalizedFilePath === this.routerFilePath) {
534
538
  logger.warn("Router file was deleted, attempting to find new router file");
535
539
  try {
536
540
  this.routerFilePath = await findRouterFile(rootPath);
@@ -544,18 +548,19 @@ export class FileSystemManager extends TracedEventEmitter {
544
548
  }
545
549
  }
546
550
  }
547
- else if (filePath in this.apiFiles) {
548
- await this.removeApiData(filePath);
551
+ else if (normalizedFilePath in this.apiFiles) {
552
+ await this.removeApiData(normalizedFilePath);
549
553
  }
550
554
  break;
551
555
  }
552
556
  }
553
557
  };
554
558
  async deleteTsFile(filePath) {
555
- delete this.tsFiles[filePath];
556
- this.sourceTracker?.removeFile(filePath);
557
- if (isPageFilePath(filePath)) {
558
- this.emit("deletePage", filePath);
559
+ const normalizedPath = normalizePath(filePath);
560
+ delete this.tsFiles[normalizedPath];
561
+ this.sourceTracker?.removeFile(normalizedPath);
562
+ if (isPageFilePath(normalizedPath)) {
563
+ this.emit("deletePage", normalizedPath);
559
564
  }
560
565
  }
561
566
  getTsFilePaths() {
@@ -571,65 +576,14 @@ export class FileSystemManager extends TracedEventEmitter {
571
576
  setTemplateRenderer(templateRenderer) {
572
577
  this.templateRenderer = templateRenderer;
573
578
  }
574
- /**
575
- * Generate TypeScript source from YAML and write to scratch directory
576
- * This is called when YAML changes (e.g., UI edits) to keep TS in sync.
577
- */
578
- syncTsFromYaml = debounce((apiName) => {
579
- return this.fsOperationQueue.enqueue(() => this._syncTsFromYaml(apiName));
580
- }, 250, { leading: true, trailing: true, maxWait: 500 });
581
- async _syncTsFromYaml(apiName) {
582
- const logger = getLogger();
583
- // Skip if we don't have templateRenderer
584
- if (!this.templateRenderer || !this.rootDir) {
585
- logger.warn(`Skipping YAML→TS sync for ${apiName}: templateRenderer or rootDir not available`);
586
- return;
587
- }
588
- logger.info(`Starting YAML→TS sync for: ${apiName}`);
589
- try {
590
- const yamlPath = renderPath(Paths.ApiYamls, { apiName });
591
- logger.debug(`Syncing TS source from YAML for API: ${apiName}`);
592
- // Create file artifact for transformation
593
- const yamlArtifact = {
594
- type: "file",
595
- filePath: yamlPath,
596
- content: "", // Transformer just needs the path
597
- };
598
- // Transform YAML to TS
599
- const outputs = await applyFileTransformations([yamlArtifact], [
600
- new YamlToApiBuilderTransformer({
601
- appRootDirPath: this.rootDir,
602
- entityNames: [], // Empty for now, could be enhanced later
603
- skipCleanup: true,
604
- templateRenderer: this.templateRenderer,
605
- }),
606
- ]);
607
- const tsArtifact = outputs[0];
608
- if (!tsArtifact) {
609
- logger.warn(`No TS artifact generated for ${apiName}`);
610
- return;
611
- }
612
- logger.debug(`Generated TS source for ${apiName}, writing to scratch`, tsArtifact.content);
613
- // Write to scratch directory
614
- const apiTsFilePath = `${renderPath(Paths.GeneratedApis, { apiName })}.ts`;
615
- const scratchPath = renderPath(Paths.Scratch, { path: apiTsFilePath });
616
- const fullPath = path.join(this.rootDir, scratchPath);
617
- await fs.mkdir(path.dirname(fullPath), { recursive: true });
618
- await fs.writeFile(fullPath, tsArtifact.content, { encoding: "utf-8" });
619
- logger.info(`✓ Synced TS source to scratch for ${apiName}`);
620
- }
621
- catch (error) {
622
- logger.error(`Failed to sync TS from YAML for ${apiName}`, getErrorMeta(error));
623
- // Don't throw - sync failure shouldn't break the API update
624
- }
625
- }
626
579
  // MARK: fs read/write
627
580
  async writeFile(path, content, kind) {
628
581
  getLogger().info(`Writing file: ${path}, kind: ${kind ?? "other"}`);
629
582
  switch (kind) {
630
583
  case "ts": {
631
584
  // happens eagerly regardless of error - possible desync
632
- this.tsFiles[path] = content;
585
+ const normalizedPath = normalizePath(path);
586
+ this.tsFiles[normalizedPath] = content;
633
587
  // TODO(george): as an optimization, we could update the memory snapshot of the file that SyncService is holding
634
588
  await this.fsOperationQueue.enqueue(async () => {
635
589
  const dir = path.substring(0, path.lastIndexOf("/"));
@@ -641,7 +595,8 @@ export class FileSystemManager extends TracedEventEmitter {
641
595
  break;
642
596
  }
643
597
  case "api": {
644
- const currentApiFile = this.apiFiles[path];
598
+ const normalizedPath = normalizePath(path);
599
+ const currentApiFile = this.apiFiles[normalizedPath];
645
600
  const apiPb = yaml.parse(content);
646
601
  // We don't need ID, organization, or trigger data in code-mode APIs
647
602
  if (apiPb.metadata) {
@@ -655,14 +610,15 @@ export class FileSystemManager extends TracedEventEmitter {
655
610
  const scopeId = getScopeIdFromName("App");
656
611
  // Update in-memory state before writing to disk (similar to TS files)
657
612
  // This allows the file watcher to detect no change and skip duplicate events
658
- this.apiFiles[path] = {
613
+ this.apiFiles[normalizedPath] = {
659
614
  apiPb: yaml.parse(JSON.stringify(apiPb)),
660
615
  stepPathMap,
661
616
  scopeId,
662
617
  };
663
618
  // TODO(george): as an optimization, we could update the memory snapshot of the file that SyncService is holding
619
+ const apiDir = nodePath.dirname(path);
664
620
  await this.fsOperationQueue.enqueue(async () => {
665
- await writeApiFiles({ apiPb }, "api", path.split("/").slice(0, -1).join("/"), false, [], [], { extractLargeSourceFiles: true, minLinesForExtraction: 1 }, new Set(Object.keys(this.apiFiles)), stepPathMap);
621
+ await writeApiFiles({ apiPb }, "api", apiDir, false, [], [], { extractLargeSourceFiles: true, minLinesForExtraction: 1 }, new Set(Object.keys(this.apiFiles)), stepPathMap);
666
622
  });
667
623
  break;
668
624
  }
@@ -679,7 +635,7 @@ export class FileSystemManager extends TracedEventEmitter {
679
635
  }
680
636
  }
681
637
  readFile(path) {
682
- return this.tsFiles[path];
638
+ return this.tsFiles[normalizePath(path)];
683
639
  }
684
640
  async setFileContents(path, contents) {
685
641
  const logger = getLogger();
@@ -704,14 +660,15 @@ export class FileSystemManager extends TracedEventEmitter {
704
660
  }
705
661
  getLocalBindingEntities(path) {
706
662
  const logger = getLogger();
663
+ const normalizedPath = normalizePath(path);
707
664
  const files = this.sourceTracker?.getCurrentFiles();
708
- if (!files || !files[path]) {
709
- logger.warn(`File not found in source tracker for local binding entities: ${path}`);
665
+ if (!files || !files[normalizedPath]) {
666
+ logger.warn(`File not found in source tracker for local binding entities: ${normalizedPath}`);
710
667
  return [];
711
668
  }
712
- const ast = files[path].ast;
669
+ const ast = files[normalizedPath].ast;
713
670
  if (!ast) {
714
- logger.warn(`No AST found for file in source tracker for local binding entities: ${path}`);
671
+ logger.warn(`No AST found for file in source tracker for local binding entities: ${normalizedPath}`);
715
672
  return [];
716
673
  }
717
674
  const localBindingEntities = new Set();
@@ -730,7 +687,7 @@ export class FileSystemManager extends TracedEventEmitter {
730
687
  return Array.from(localBindingEntities);
731
688
  }
732
689
  getPageRootNodes(filePath) {
733
- const scopeFilePath = path.join(path.dirname(filePath), "index.tsx");
690
+ const scopeFilePath = normalizePath(nodePath.join(nodePath.dirname(filePath), "index.tsx"));
734
691
  return this.getRootNodesForFile(scopeFilePath);
735
692
  }
736
693
  getAppRootNodes() {
@@ -750,8 +707,8 @@ export class FileSystemManager extends TracedEventEmitter {
750
707
  let resolvedPath = await getFullImportPath(localPath);
751
708
  // Fallback: manually resolve relative paths if Vite resolver fails
752
709
  if (!resolvedPath && localPath.startsWith(".")) {
753
- const currentDir = path.dirname(filePath);
754
- const potentialPath = path.resolve(currentDir, localPath);
710
+ const currentDir = nodePath.dirname(filePath);
711
+ const potentialPath = nodePath.resolve(currentDir, localPath);
755
712
  // Try with different extensions
756
713
  const extensions = [
757
714
  "/index.tsx",
@@ -781,22 +738,24 @@ export class FileSystemManager extends TracedEventEmitter {
781
738
  return importedFiles;
782
739
  }
783
740
  async getRootNodesForFile(filePath) {
784
- const currentFile = this.sourceTracker?.getCurrentFiles()[filePath];
741
+ const normalizedPath = normalizePath(filePath);
742
+ const currentFile = this.sourceTracker?.getCurrentFiles()[normalizedPath];
785
743
  if (!currentFile) {
786
744
  return undefined;
787
745
  }
788
746
  const allFiles = this.sourceTracker?.getCurrentFiles() ?? {};
789
747
  // Collect all imported files recursively (including transitive imports)
790
- const importedNamesToFiles = await this.collectAllImports(filePath, allFiles);
748
+ const importedNamesToFiles = await this.collectAllImports(normalizedPath, allFiles);
791
749
  // Get roots from imported files (custom components)
792
750
  const importedRoots = Object.entries(importedNamesToFiles).flatMap(([filePath, file]) => getRootNodes(filePath, file));
793
751
  // Get roots from the current file
794
- const roots = getRootNodes(filePath, currentFile);
752
+ const roots = getRootNodes(normalizedPath, currentFile);
795
753
  return [...roots, ...importedRoots];
796
754
  }
797
755
  getScope(filePath, fallback) {
798
756
  // Since we no longer use scope.ts files, generate scope info from file path. Pages retain page scope, everything else is App.
799
- const scopeName = getScopeNameFromPath(filePath);
757
+ const normalizedPath = normalizePath(filePath);
758
+ const scopeName = getScopeNameFromPath(normalizedPath);
800
759
  if (!scopeName) {
801
760
  if (fallback) {
802
761
  return {
@@ -972,8 +931,8 @@ export class FileSystemManager extends TracedEventEmitter {
972
931
  if (!this.rootDir) {
973
932
  throw new Error("Root directory not set");
974
933
  }
975
- // no leading slash
976
- return path.relative(path.join(this.rootDir, PAGES_DIRECTORY), filePath);
934
+ // no leading slash, normalize to forward slashes for routes (Windows compatibility)
935
+ return normalizePath(nodePath.relative(nodePath.join(this.rootDir, PAGES_DIRECTORY), filePath));
977
936
  }
978
937
  // MARK: API operations
979
938
  handleUpdateApi = async (payload) => {
@@ -990,7 +949,8 @@ export class FileSystemManager extends TracedEventEmitter {
990
949
  throw new Error("Root directory not set");
991
950
  }
992
951
  const apiFilePath = getApiFilePath(this.rootDir, apiName);
993
- const apiDir = path.dirname(apiFilePath);
952
+ const normalizedApiFilePath = normalizePath(apiFilePath);
953
+ const apiDir = nodePath.dirname(normalizedApiFilePath);
994
954
  try {
995
955
  const stats = await fs.stat(apiDir);
996
956
  if (!stats.isDirectory()) {
@@ -1017,11 +977,12 @@ export class FileSystemManager extends TracedEventEmitter {
1017
977
  const deletedApis = [];
1018
978
  for (const { apiName } of apis) {
1019
979
  const apiFilePath = getApiFilePath(rootDir, apiName);
1020
- const api = this.apiFiles[apiFilePath];
980
+ const normalizedApiFilePath = normalizePath(apiFilePath);
981
+ const api = this.apiFiles[normalizedApiFilePath];
1021
982
  if (!api || !this.sourceTracker) {
1022
983
  continue;
1023
984
  }
1024
- const apiDir = path.dirname(apiFilePath);
985
+ const apiDir = nodePath.dirname(apiFilePath);
1025
986
  try {
1026
987
  await this.fsOperationQueue.enqueue(async () => {
1027
988
  const stats = await fs.stat(apiDir);
@@ -1029,7 +990,7 @@ export class FileSystemManager extends TracedEventEmitter {
1029
990
  await fs.rmdir(apiDir, { recursive: true });
1030
991
  }
1031
992
  });
1032
- delete this.apiFiles[apiFilePath];
993
+ delete this.apiFiles[normalizedApiFilePath];
1033
994
  const scopeId = this.sourceTracker.deleteApi({
1034
995
  apiName,
1035
996
  });
@@ -1054,15 +1015,16 @@ export class FileSystemManager extends TracedEventEmitter {
1054
1015
  if (!this.rootDir) {
1055
1016
  throw new Error("Root directory not set");
1056
1017
  }
1057
- const existingApiFolder = path.join(this.rootDir, "apis", oldName);
1058
- const newApiFolder = path.join(this.rootDir, "apis", newName);
1059
- const apiFilePath = path.join(existingApiFolder, "api.yaml");
1060
- const apiDef = this.apiFiles[apiFilePath];
1018
+ const existingApiFolder = nodePath.join(this.rootDir, "apis", oldName);
1019
+ const newApiFolder = nodePath.join(this.rootDir, "apis", newName);
1020
+ const apiFilePath = nodePath.join(existingApiFolder, "api.yaml");
1021
+ const normalizedApiFilePath = normalizePath(apiFilePath);
1022
+ const apiDef = this.apiFiles[normalizedApiFilePath];
1061
1023
  if (!apiDef) {
1062
1024
  throw new Error(`API ${oldName} not found`);
1063
1025
  }
1064
1026
  const otherAPIs = structuredClone(Object.keys(this.apiFiles)
1065
- .filter((path) => path !== apiFilePath)
1027
+ .filter((path) => path !== normalizedApiFilePath)
1066
1028
  .map((path) => ({
1067
1029
  api: { apiPb: this.apiFiles[path]?.apiPb },
1068
1030
  filePath: path,
@@ -1077,9 +1039,9 @@ export class FileSystemManager extends TracedEventEmitter {
1077
1039
  apiDef.apiPb.metadata.name = newName;
1078
1040
  await fs.rename(existingApiFolder, newApiFolder);
1079
1041
  const scopeId = getScopeIdFromName("App");
1080
- delete this.apiFiles[apiFilePath];
1042
+ delete this.apiFiles[normalizedApiFilePath];
1081
1043
  // not waiting because we are queueing the write further down
1082
- void this.writeFile(path.join(newApiFolder, "api.yaml"), yaml.stringify(apiDef.apiPb), "api");
1044
+ void this.writeFile(nodePath.join(newApiFolder, "api.yaml"), yaml.stringify(apiDef.apiPb), "api");
1083
1045
  this.watcher?.add(existingApiFolder);
1084
1046
  this.watcher?.add(newApiFolder);
1085
1047
  const changes = (await this.sourceTracker?.getAndFlushChanges()) ?? [];
@@ -1107,11 +1069,12 @@ export class FileSystemManager extends TracedEventEmitter {
1107
1069
  }));
1108
1070
  };
1109
1071
  async removeApiData(filePath) {
1110
- const api = this.apiFiles[filePath];
1072
+ const normalizedPath = normalizePath(filePath);
1073
+ const api = this.apiFiles[normalizedPath];
1111
1074
  if (!api) {
1112
1075
  return;
1113
1076
  }
1114
- delete this.apiFiles[filePath];
1077
+ delete this.apiFiles[normalizedPath];
1115
1078
  this.sourceTracker?.deleteApi({
1116
1079
  apiName: api.apiPb.metadata.name,
1117
1080
  });
@@ -1170,9 +1133,10 @@ export class FileSystemManager extends TracedEventEmitter {
1170
1133
  let yamlPath = filePath;
1171
1134
  if (fileType.type === "python-api-step" ||
1172
1135
  fileType.type === "js-api-step") {
1173
- const apiFolderPath = filePath.split("/").slice(0, -1).join("/");
1174
- yamlPath = path.join(apiFolderPath, "api.yaml");
1136
+ const apiFolderPath = nodePath.dirname(filePath);
1137
+ yamlPath = nodePath.join(apiFolderPath, "api.yaml");
1175
1138
  }
1139
+ const normalizedYamlPath = normalizePath(yamlPath);
1176
1140
  const logger = getLogger();
1177
1141
  logger.info(`Processing API file update: ${yamlPath}`);
1178
1142
  try {
@@ -1183,9 +1147,9 @@ export class FileSystemManager extends TracedEventEmitter {
1183
1147
  }
1184
1148
  logger.info(`API structure is valid: ${yamlPath}`);
1185
1149
  const parsedData = { apiPb: apiContent?.api };
1186
- if (yamlPath in this.apiFiles &&
1187
- isEqual(this.apiFiles[yamlPath]?.apiPb, parsedData.apiPb)) {
1188
- logger.info(`No changes detected in API: ${yamlPath}`);
1150
+ if (normalizedYamlPath in this.apiFiles &&
1151
+ isEqual(this.apiFiles[normalizedYamlPath]?.apiPb, parsedData.apiPb)) {
1152
+ logger.info(`No changes detected in API: ${normalizedYamlPath}`);
1189
1153
  return;
1190
1154
  }
1191
1155
  const { updatedApi, isNewApi } = this.updateInternalApiData({
@@ -1251,28 +1215,35 @@ export class MockFileSyncManager extends FileSystemManager {
1251
1215
  }
1252
1216
  async writeFile(path, content, kind) {
1253
1217
  await this.fsOperationQueue.enqueue(async () => {
1218
+ const normalizedPath = normalizePath(path);
1254
1219
  if (kind === "ts") {
1255
- this.tsFiles[path] = content;
1220
+ this.tsFiles[normalizedPath] = content;
1256
1221
  }
1257
1222
  else {
1258
- this.apiFiles[path] = {
1223
+ this.apiFiles[normalizedPath] = {
1259
1224
  apiPb: yaml.parse(content),
1260
1225
  stepPathMap: {},
1261
1226
  scopeId: getScopeIdFromName("App"),
1262
1227
  };
1263
1228
  }
1264
1229
  // Notify subscribers
1265
- this.emit("fileChanged", path, content, true);
1230
+ this.emit("fileChanged", normalizedPath, content, true);
1266
1231
  });
1267
1232
  }
1268
1233
  // Helper methods for testing
1269
1234
  mockFileChange(path, content) {
1270
- this.tsFiles[path] = content;
1271
- this.emit("fileChanged", path, content, true);
1235
+ const normalizedPath = normalizePath(path);
1236
+ this.tsFiles[normalizedPath] = content;
1237
+ this.emit("fileChanged", normalizedPath, content, true);
1272
1238
  }
1273
1239
  handleUpdateApi = async (payload) => {
1274
1240
  const apiName = payload.api.apiPb.metadata.name;
1275
- this.apiFiles[apiName] = {
1241
+ if (!this.rootDir) {
1242
+ throw new Error("Root directory not set");
1243
+ }
1244
+ const apiFilePath = getApiFilePath(this.rootDir, apiName);
1245
+ const normalizedApiFilePath = normalizePath(apiFilePath);
1246
+ this.apiFiles[normalizedApiFilePath] = {
1276
1247
  ...payload.api,
1277
1248
  stepPathMap: {},
1278
1249
  scopeId: payload.scopeId,
@@ -1303,7 +1274,9 @@ async function readFile(path) {
1303
1274
  }
1304
1275
  }
1305
1276
  async function readFiles(dir) {
1306
- return await glob(path.join(dir, "**/*.{tsx,yaml,ts}"), {
1277
+ const files = await glob("**/*.{tsx,yaml,ts}", {
1278
+ cwd: dir,
1279
+ absolute: true,
1307
1280
  ignore: [
1308
1281
  "node_modules/**",
1309
1282
  "dist/**",
@@ -1312,8 +1285,10 @@ async function readFiles(dir) {
1312
1285
  `./${getLegacyComponentsFolder()}/**`,
1313
1286
  ],
1314
1287
  });
1288
+ // Normalize paths to use forward slashes on all platforms (Windows returns backslashes)
1289
+ return files.map((file) => normalizePath(file));
1315
1290
  }
1316
- const getMergedApiContent = async (path) => {
1317
- return readAppApiYamlFile(path.split("/").slice(0, -1).join("/"));
1291
+ const getMergedApiContent = async (filePath) => {
1292
+ return readAppApiYamlFile(nodePath.dirname(filePath));
1318
1293
  };
1319
1294
  //# sourceMappingURL=file-system-manager.js.map