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

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 +0 -14
  2. package/dist/ai-service/agent/middleware.d.ts.map +1 -1
  3. package/dist/ai-service/agent/middleware.js +0 -40
  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 +18 -67
  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 +5 -11
  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 +0 -15
  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 +0 -3
  16. package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
  17. package/dist/ai-service/agent/tools/apis/api-source.d.ts +24 -0
  18. package/dist/ai-service/agent/tools/apis/api-source.d.ts.map +1 -0
  19. package/dist/ai-service/agent/tools/apis/api-source.js +108 -0
  20. package/dist/ai-service/agent/tools/apis/api-source.js.map +1 -0
  21. package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
  22. package/dist/ai-service/agent/tools/apis/build-api-artifact.js +3 -11
  23. package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -1
  24. package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
  25. package/dist/ai-service/agent/tools/apis/build-api.js +0 -6
  26. package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
  27. package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -1
  28. package/dist/ai-service/agent/tools/apis/get-api-docs.js +3 -99
  29. package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -1
  30. package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -1
  31. package/dist/ai-service/agent/tools/apis/integration-types.js +17 -69
  32. package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -1
  33. package/dist/ai-service/agent/tools/apis/test-api.d.ts +1 -1
  34. package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
  35. package/dist/ai-service/agent/tools/apis/test-api.js +45 -26
  36. package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
  37. package/dist/ai-service/agent/tools/apis/write-api.d.ts +2 -2
  38. package/dist/ai-service/agent/tools/apis/write-api.d.ts.map +1 -1
  39. package/dist/ai-service/agent/tools/apis/write-api.js +2 -8
  40. package/dist/ai-service/agent/tools/apis/write-api.js.map +1 -1
  41. package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
  42. package/dist/ai-service/agent/tools/build-capture-screenshot.js +0 -3
  43. package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
  44. package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
  45. package/dist/ai-service/agent/tools/build-debug.js +6 -58
  46. package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
  47. package/dist/ai-service/agent/tools/build-delete-file.d.ts +1 -1
  48. package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
  49. package/dist/ai-service/agent/tools/build-delete-file.js +196 -27
  50. package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -1
  51. package/dist/ai-service/agent/tools/build-edit-file.d.ts +1 -1
  52. package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
  53. package/dist/ai-service/agent/tools/build-edit-file.js +22 -12
  54. package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
  55. package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
  56. package/dist/ai-service/agent/tools/build-finalize.js +0 -3
  57. package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
  58. package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
  59. package/dist/ai-service/agent/tools/build-install-packages.js +0 -15
  60. package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
  61. package/dist/ai-service/agent/tools/build-list-files.d.ts +1 -1
  62. package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -1
  63. package/dist/ai-service/agent/tools/build-list-files.js +14 -6
  64. package/dist/ai-service/agent/tools/build-list-files.js.map +1 -1
  65. package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
  66. package/dist/ai-service/agent/tools/build-manage-checklist.js +0 -9
  67. package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
  68. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +2 -2
  69. package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
  70. package/dist/ai-service/agent/tools/build-multi-edit-file.js +25 -8
  71. package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
  72. package/dist/ai-service/agent/tools/build-read-file.d.ts +4 -10
  73. package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -1
  74. package/dist/ai-service/agent/tools/build-read-file.js +77 -75
  75. package/dist/ai-service/agent/tools/build-read-file.js.map +1 -1
  76. package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -1
  77. package/dist/ai-service/agent/tools/build-reload-file.js +0 -5
  78. package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -1
  79. package/dist/ai-service/agent/tools/build-rename-file.d.ts +1 -1
  80. package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -1
  81. package/dist/ai-service/agent/tools/build-rename-file.js +50 -3
  82. package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -1
  83. package/dist/ai-service/agent/tools/build-validate-icons.d.ts.map +1 -1
  84. package/dist/ai-service/agent/tools/build-validate-icons.js +0 -8
  85. package/dist/ai-service/agent/tools/build-validate-icons.js.map +1 -1
  86. package/dist/ai-service/agent/tools/build-write-file.d.ts +2 -2
  87. package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
  88. package/dist/ai-service/agent/tools/build-write-file.js +17 -7
  89. package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
  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 +0 -6
  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 +0 -4
  95. package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -1
  96. package/dist/ai-service/agent/tools/index.d.ts +0 -1
  97. package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
  98. package/dist/ai-service/agent/tools/index.js +0 -1
  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 +9 -56
  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 +0 -6
  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 +0 -9
  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 +6 -27
  111. package/dist/ai-service/agent/tools.js.map +1 -1
  112. package/dist/ai-service/agent/tools2/registry.d.ts +0 -15
  113. package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
  114. package/dist/ai-service/agent/tools2/registry.js +0 -30
  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 +1 -11
  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 +1 -4
  120. package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -1
  121. package/dist/ai-service/agent/tools2/tools/edit.js +8 -10
  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 +0 -5
  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 +0 -2
  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 +0 -24
  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 +1 -4
  131. package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -1
  132. package/dist/ai-service/agent/tools2/tools/glob.js +85 -25
  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 +0 -9
  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 +5 -22
  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 +0 -4
  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 +1 -8
  145. package/dist/ai-service/agent/tools2/tools/ls.d.ts.map +1 -1
  146. package/dist/ai-service/agent/tools2/tools/ls.js +83 -102
  147. package/dist/ai-service/agent/tools2/tools/ls.js.map +1 -1
  148. package/dist/ai-service/agent/tools2/tools/read.d.ts +2 -5
  149. package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -1
  150. package/dist/ai-service/agent/tools2/tools/read.js +12 -24
  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 +0 -13
  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 +0 -6
  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 +1 -4
  159. package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -1
  160. package/dist/ai-service/agent/tools2/tools/write.js +4 -9
  161. package/dist/ai-service/agent/tools2/tools/write.js.map +1 -1
  162. package/dist/ai-service/agent/tools2/types.d.ts +0 -25
  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/linter.d.ts +1 -4
  166. package/dist/ai-service/app-interface/linter.d.ts.map +1 -1
  167. package/dist/ai-service/app-interface/linter.js +6 -10
  168. package/dist/ai-service/app-interface/linter.js.map +1 -1
  169. package/dist/ai-service/app-interface/shell.d.ts +1 -205
  170. package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
  171. package/dist/ai-service/app-interface/shell.js +14 -474
  172. package/dist/ai-service/app-interface/shell.js.map +1 -1
  173. package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
  174. package/dist/ai-service/chat/chat-session-store.js +0 -8
  175. package/dist/ai-service/chat/chat-session-store.js.map +1 -1
  176. package/dist/ai-service/features.d.ts +0 -8
  177. package/dist/ai-service/features.d.ts.map +1 -1
  178. package/dist/ai-service/features.js +0 -8
  179. package/dist/ai-service/features.js.map +1 -1
  180. package/dist/ai-service/index.d.ts +1 -1
  181. package/dist/ai-service/index.d.ts.map +1 -1
  182. package/dist/ai-service/index.js +24 -26
  183. package/dist/ai-service/index.js.map +1 -1
  184. package/dist/ai-service/judge/judge-executor.d.ts.map +1 -1
  185. package/dist/ai-service/judge/judge-executor.js +0 -4
  186. package/dist/ai-service/judge/judge-executor.js.map +1 -1
  187. package/dist/ai-service/llm/client.d.ts +3 -19
  188. package/dist/ai-service/llm/client.d.ts.map +1 -1
  189. package/dist/ai-service/llm/client.js +12 -131
  190. package/dist/ai-service/llm/client.js.map +1 -1
  191. package/dist/ai-service/llm/context/context.d.ts +1 -4
  192. package/dist/ai-service/llm/context/context.d.ts.map +1 -1
  193. package/dist/ai-service/llm/context/context.js +5 -27
  194. package/dist/ai-service/llm/context/context.js.map +1 -1
  195. package/dist/ai-service/llm/context/internal-types.d.ts +0 -5
  196. package/dist/ai-service/llm/context/internal-types.d.ts.map +1 -1
  197. package/dist/ai-service/llm/context/internal-types.js +0 -5
  198. package/dist/ai-service/llm/context/internal-types.js.map +1 -1
  199. package/dist/ai-service/llm/context/levels/l1.d.ts +3 -4
  200. package/dist/ai-service/llm/context/levels/l1.d.ts.map +1 -1
  201. package/dist/ai-service/llm/context/levels/l1.js +8 -9
  202. package/dist/ai-service/llm/context/levels/l1.js.map +1 -1
  203. package/dist/ai-service/llm/context/serialization.d.ts +0 -8
  204. package/dist/ai-service/llm/context/serialization.d.ts.map +1 -1
  205. package/dist/ai-service/llm/context/utils/content-compaction.d.ts +5 -7
  206. package/dist/ai-service/llm/context/utils/content-compaction.d.ts.map +1 -1
  207. package/dist/ai-service/llm/context/utils/content-compaction.js +6 -27
  208. package/dist/ai-service/llm/context/utils/content-compaction.js.map +1 -1
  209. package/dist/ai-service/llm/error.d.ts +0 -1
  210. package/dist/ai-service/llm/error.d.ts.map +1 -1
  211. package/dist/ai-service/llm/error.js +3 -29
  212. package/dist/ai-service/llm/error.js.map +1 -1
  213. package/dist/ai-service/llm/stream/config.d.ts +5 -14
  214. package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
  215. package/dist/ai-service/llm/stream/config.js +5 -17
  216. package/dist/ai-service/llm/stream/config.js.map +1 -1
  217. package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
  218. package/dist/ai-service/llm/stream/errors.js +4 -7
  219. package/dist/ai-service/llm/stream/errors.js.map +1 -1
  220. package/dist/ai-service/llm/stream/index.d.ts +2 -4
  221. package/dist/ai-service/llm/stream/index.d.ts.map +1 -1
  222. package/dist/ai-service/llm/stream/index.js +2 -4
  223. package/dist/ai-service/llm/stream/index.js.map +1 -1
  224. package/dist/ai-service/llm/stream/orchestrator.d.ts +1 -1
  225. package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
  226. package/dist/ai-service/llm/stream/orchestrator.js +11 -5
  227. package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
  228. package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
  229. package/dist/ai-service/llm/stream/retry-engine.js +3 -3
  230. package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
  231. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts +0 -8
  232. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -1
  233. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js +0 -108
  234. package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -1
  235. package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -1
  236. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +133 -360
  237. package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
  238. package/dist/ai-service/state-machine/clark-fsm.d.ts +1 -2
  239. package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
  240. package/dist/ai-service/state-machine/clark-fsm.js +8 -29
  241. package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
  242. package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
  243. package/dist/ai-service/state-machine/handlers/agent-planning.js +6 -17
  244. package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
  245. package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
  246. package/dist/ai-service/state-machine/handlers/llm-generating.js +1 -9
  247. package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
  248. package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts +7 -0
  249. package/dist/ai-service/state-machine/helpers/file-read-tracker.d.ts.map +1 -0
  250. package/dist/ai-service/state-machine/helpers/file-read-tracker.js +26 -0
  251. package/dist/ai-service/state-machine/helpers/file-read-tracker.js.map +1 -0
  252. package/dist/ai-service/template-renderer.d.ts.map +1 -1
  253. package/dist/ai-service/template-renderer.js +1 -4
  254. package/dist/ai-service/template-renderer.js.map +1 -1
  255. package/dist/ai-service/transform/api-builder/shared.js +2 -2
  256. package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
  257. package/dist/components-manager.d.ts.map +1 -1
  258. package/dist/components-manager.js +12 -17
  259. package/dist/components-manager.js.map +1 -1
  260. package/dist/file-sync-vite-plugin.d.ts.map +1 -1
  261. package/dist/file-sync-vite-plugin.js +12 -22
  262. package/dist/file-sync-vite-plugin.js.map +1 -1
  263. package/dist/file-system-manager.d.ts +6 -0
  264. package/dist/file-system-manager.d.ts.map +1 -1
  265. package/dist/file-system-manager.js +144 -119
  266. package/dist/file-system-manager.js.map +1 -1
  267. package/dist/parsing/util.d.ts.map +1 -1
  268. package/dist/parsing/util.js +1 -5
  269. package/dist/parsing/util.js.map +1 -1
  270. package/dist/socket-manager.d.ts.map +1 -1
  271. package/dist/socket-manager.js +11 -5
  272. package/dist/socket-manager.js.map +1 -1
  273. package/dist/source-tracker.d.ts +0 -4
  274. package/dist/source-tracker.d.ts.map +1 -1
  275. package/dist/source-tracker.js +8 -15
  276. package/dist/source-tracker.js.map +1 -1
  277. package/dist/sync-service/index.d.ts.map +1 -1
  278. package/dist/sync-service/index.js +8 -13
  279. package/dist/sync-service/index.js.map +1 -1
  280. package/dist/util/logger.d.ts.map +1 -1
  281. package/dist/util/logger.js +0 -16
  282. package/dist/util/logger.js.map +1 -1
  283. package/dist/util.d.ts +1 -1
  284. package/dist/util.d.ts.map +1 -1
  285. package/dist/util.js +2 -4
  286. package/dist/util.js.map +1 -1
  287. package/package.json +16 -10
  288. package/dist/ai-service/agent/tools/clear-error-cache.d.ts +0 -10
  289. package/dist/ai-service/agent/tools/clear-error-cache.d.ts.map +0 -1
  290. package/dist/ai-service/agent/tools/clear-error-cache.js +0 -38
  291. package/dist/ai-service/agent/tools/clear-error-cache.js.map +0 -1
  292. package/dist/ai-service/app-interface/constants.d.ts +0 -77
  293. package/dist/ai-service/app-interface/constants.d.ts.map +0 -1
  294. package/dist/ai-service/app-interface/constants.js +0 -129
  295. package/dist/ai-service/app-interface/constants.js.map +0 -1
  296. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +0 -87
  297. package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +0 -1
  298. package/dist/ai-service/app-interface/filesystem/draft-manager.js +0 -91
  299. package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +0 -1
  300. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts +0 -35
  301. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +0 -1
  302. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js +0 -236
  303. package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js.map +0 -1
  304. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts +0 -5
  305. package/dist/ai-service/app-interface/filesystem/handlers/index.d.ts.map +0 -1
  306. package/dist/ai-service/app-interface/filesystem/handlers/index.js +0 -5
  307. package/dist/ai-service/app-interface/filesystem/handlers/index.js.map +0 -1
  308. package/dist/ai-service/app-interface/filesystem/index.d.ts +0 -12
  309. package/dist/ai-service/app-interface/filesystem/index.d.ts.map +0 -1
  310. package/dist/ai-service/app-interface/filesystem/index.js +0 -11
  311. package/dist/ai-service/app-interface/filesystem/index.js.map +0 -1
  312. package/dist/ai-service/app-interface/filesystem/validation.d.ts +0 -71
  313. package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +0 -1
  314. package/dist/ai-service/app-interface/filesystem/validation.js +0 -170
  315. package/dist/ai-service/app-interface/filesystem/validation.js.map +0 -1
  316. package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +0 -108
  317. package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +0 -1
  318. package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +0 -157
  319. package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +0 -1
  320. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts +0 -126
  321. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts.map +0 -1
  322. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js +0 -9
  323. package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js.map +0 -1
  324. package/dist/ai-service/security/index.d.ts +0 -8
  325. package/dist/ai-service/security/index.d.ts.map +0 -1
  326. package/dist/ai-service/security/index.js +0 -8
  327. package/dist/ai-service/security/index.js.map +0 -1
  328. package/dist/ai-service/security/safety-classifier.d.ts +0 -103
  329. package/dist/ai-service/security/safety-classifier.d.ts.map +0 -1
  330. package/dist/ai-service/security/safety-classifier.js +0 -168
  331. package/dist/ai-service/security/safety-classifier.js.map +0 -1
  332. package/dist/ai-service/security/secret-scanner.d.ts +0 -145
  333. package/dist/ai-service/security/secret-scanner.d.ts.map +0 -1
  334. package/dist/ai-service/security/secret-scanner.js +0 -344
  335. package/dist/ai-service/security/secret-scanner.js.map +0 -1
  336. package/dist/ensure-app-provider.d.ts +0 -2
  337. package/dist/ensure-app-provider.d.ts.map +0 -1
  338. package/dist/ensure-app-provider.js +0 -209
  339. package/dist/ensure-app-provider.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"api-handler.js","sourceRoot":"","sources":["../../../../../src/ai-service/app-interface/filesystem/handlers/api-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,EAAE,EACF,OAAO,EACP,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AAUtC,gBAAgB;AAChB,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AAC1D,MAAM,oBAAoB,GAAG,kBAAkB,CAC7C,eAAe,EACf,gBAAgB,EAChB,kBAAkB,CACnB,CAAC;AAEF;;;GAGG;AACH,SAAS,oBAAoB,CAAC,YAAoB;IAChD,MAAM,KAAK,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,EA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,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QAEzD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC;YACvC,OAAO;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,WAAW,EAAE,KAAK;gBAClB,MAAM,EAAE,IAAI;aACb,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB,CACnC,OAAe,EACf,cAAsB,EACtB,iBAA0D,EAC1D,YAAsB;QAEtB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAEhE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAChD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;YAE7D,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,MAAM,IAAI,CAAC,uBAAuB,CAChC,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,YAAY,CACb,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,iBAAiB,CAAC,YAAY,CAAC,CAAC;gBACtC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Virtual file handlers.
3
- */
4
- export { ApiFileHandler } from "./api-handler.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/app-interface/filesystem/handlers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Virtual file handlers.
3
- */
4
- export { ApiFileHandler } from "./api-handler.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai-service/app-interface/filesystem/handlers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Filesystem abstraction layer for AppShell.
3
- *
4
- * Re-exports all filesystem-related utilities including validation,
5
- * virtual filesystem operations, and draft management.
6
- */
7
- export * from "./validation.js";
8
- export { DraftManager, type DraftChanges } from "./draft-manager.js";
9
- export type { FileMetadata, VirtualFileHandler, VirtualPathInfo, VirtualReadOptions, VirtualWriteOptions, VirtualDeleteOptions, } from "./virtual-fs-types.js";
10
- export { VirtualFileSystem, createDefaultVirtualFileSystem, } from "./virtual-file-system.js";
11
- export { ApiFileHandler } from "./handlers/index.js";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGrE,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Filesystem abstraction layer for AppShell.
3
- *
4
- * Re-exports all filesystem-related utilities including validation,
5
- * virtual filesystem operations, and draft management.
6
- */
7
- export * from "./validation.js";
8
- export { DraftManager } from "./draft-manager.js";
9
- export { VirtualFileSystem, createDefaultVirtualFileSystem, } from "./virtual-file-system.js";
10
- export { ApiFileHandler } from "./handlers/index.js";
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAC;AAWrE,OAAO,EACL,iBAAiB,EACjB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,71 +0,0 @@
1
- /**
2
- * File operation validation utilities.
3
- *
4
- * Provides centralized validation logic for all filesystem operations,
5
- * including blacklist checking, path restrictions, and operation-specific rules.
6
- */
7
- import { type FileOperation, type FileOperationValidationOptions } from "../constants.js";
8
- /**
9
- * Error thrown when a file operation fails validation.
10
- */
11
- export declare class FileValidationError extends Error {
12
- readonly code: "BLACKLISTED" | "API_FILE" | "SCOPE_FILE" | "PACKAGE_JSON" | "DIRECT_PAGE" | "ROOT_DIR" | "READ_REQUIRED";
13
- constructor(message: string, code: "BLACKLISTED" | "API_FILE" | "SCOPE_FILE" | "PACKAGE_JSON" | "DIRECT_PAGE" | "ROOT_DIR" | "READ_REQUIRED");
14
- }
15
- /**
16
- * Checks if a path is an API file path (starts with "apis/").
17
- *
18
- * @param filePath - Relative file path to check
19
- * @returns true if the path is an API file path
20
- */
21
- export declare function isApiFilePath(filePath: string): boolean;
22
- /**
23
- * Checks if a path is a direct page path (pages/xyz.tsx rather than pages/xyz/index.tsx).
24
- *
25
- * @param filePath - Relative file path to check
26
- * @returns true if the path is a direct page file
27
- */
28
- export declare function isDirectPagePath(filePath: string): boolean;
29
- /**
30
- * Checks if a path is a scope file.
31
- *
32
- * @param filePath - Relative file path to check
33
- * @returns true if the path is a scope file
34
- */
35
- export declare function isScopeFile(filePath: string): boolean;
36
- /**
37
- * Checks if a path is the package.json file.
38
- *
39
- * @param filePath - Relative file path to check
40
- * @returns true if the path is package.json
41
- */
42
- export declare function isPackageJson(filePath: string): boolean;
43
- /**
44
- * Checks if a path is in the blacklist.
45
- *
46
- * @param relativePath - Relative path to check
47
- * @param appRootDirPath - Application root directory for relative path calculation
48
- * @returns Error message if blacklisted, null otherwise
49
- */
50
- export declare function checkBlacklist(relativePath: string, _appRootDirPath: string): string | null;
51
- /**
52
- * Validates a file operation against all applicable rules.
53
- *
54
- * @param operation - The type of file operation
55
- * @param relativePath - Relative path of the file
56
- * @param appRootDirPath - Application root directory
57
- * @param options - Optional validation options to override defaults
58
- * @throws FileValidationError if validation fails
59
- */
60
- export declare function validateFileOperation(operation: FileOperation, relativePath: string, appRootDirPath: string, options?: Partial<FileOperationValidationOptions>): void;
61
- /**
62
- * Recursively checks if a directory contains any blacklisted content.
63
- *
64
- * @param entries - Directory entries to scan
65
- * @returns Error message if blacklisted content found, null otherwise
66
- */
67
- export declare function checkDirectoryContentBlacklist(entries: Array<{
68
- name: string;
69
- isDirectory: boolean;
70
- }>): string | null;
71
- //# sourceMappingURL=validation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,8BAA8B,EACpC,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;aAG1B,IAAI,EAChB,aAAa,GACb,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,UAAU,GACV,eAAe;gBARnB,OAAO,EAAE,MAAM,EACC,IAAI,EAChB,aAAa,GACb,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,UAAU,GACV,eAAe;CAKtB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAcD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,IAAI,CAoDf;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,GAChD,IAAI,CA6CN;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC,GACrD,MAAM,GAAG,IAAI,CA8Bf"}
@@ -1,170 +0,0 @@
1
- /**
2
- * File operation validation utilities.
3
- *
4
- * Provides centralized validation logic for all filesystem operations,
5
- * including blacklist checking, path restrictions, and operation-specific rules.
6
- */
7
- import path from "node:path";
8
- import { FILE_OPERATION_BLACKLIST, DEFAULT_VALIDATION_OPTIONS, } from "../constants.js";
9
- /**
10
- * Error thrown when a file operation fails validation.
11
- */
12
- export class FileValidationError extends Error {
13
- code;
14
- constructor(message, code) {
15
- super(message);
16
- this.code = code;
17
- this.name = "FileValidationError";
18
- }
19
- }
20
- /**
21
- * Checks if a path is an API file path (starts with "apis/").
22
- *
23
- * @param filePath - Relative file path to check
24
- * @returns true if the path is an API file path
25
- */
26
- export function isApiFilePath(filePath) {
27
- return filePath.startsWith("apis/");
28
- }
29
- /**
30
- * Checks if a path is a direct page path (pages/xyz.tsx rather than pages/xyz/index.tsx).
31
- *
32
- * @param filePath - Relative file path to check
33
- * @returns true if the path is a direct page file
34
- */
35
- export function isDirectPagePath(filePath) {
36
- return /^pages\/[^/]+\.tsx$/.test(filePath);
37
- }
38
- /**
39
- * Checks if a path is a scope file.
40
- *
41
- * @param filePath - Relative file path to check
42
- * @returns true if the path is a scope file
43
- */
44
- export function isScopeFile(filePath) {
45
- return filePath === "scope.ts" || filePath.endsWith("/scope.ts");
46
- }
47
- /**
48
- * Checks if a path is the package.json file.
49
- *
50
- * @param filePath - Relative file path to check
51
- * @returns true if the path is package.json
52
- */
53
- export function isPackageJson(filePath) {
54
- return filePath === "package.json" || filePath.endsWith("/package.json");
55
- }
56
- /**
57
- * Checks if a file name matches any of the protected patterns.
58
- *
59
- * @param fileName - The file name (not full path) to check
60
- * @returns true if the file name is protected
61
- */
62
- function matchesProtectedPattern(fileName) {
63
- return FILE_OPERATION_BLACKLIST.patterns.some((pattern) => pattern.test(fileName));
64
- }
65
- /**
66
- * Checks if a path is in the blacklist.
67
- *
68
- * @param relativePath - Relative path to check
69
- * @param appRootDirPath - Application root directory for relative path calculation
70
- * @returns Error message if blacklisted, null otherwise
71
- */
72
- export function checkBlacklist(relativePath, _appRootDirPath) {
73
- const fileName = path.basename(relativePath);
74
- // Check if it's the app root
75
- if (relativePath === "" || relativePath === ".") {
76
- return "Cannot operate on the application root directory";
77
- }
78
- // Check exact paths
79
- if (FILE_OPERATION_BLACKLIST.exactPaths.includes(fileName)) {
80
- return `Cannot operate on protected file: ${fileName}`;
81
- }
82
- // Check protected directories
83
- if (FILE_OPERATION_BLACKLIST.directories.includes(fileName)) {
84
- return `Cannot operate on protected directory: ${fileName}`;
85
- }
86
- // Check if path starts with a protected directory
87
- const firstDir = relativePath.split("/")[0];
88
- if (firstDir &&
89
- FILE_OPERATION_BLACKLIST.directories.includes(firstDir)) {
90
- // Special case: apis directory is allowed for virtual file operations
91
- if (firstDir === "apis") {
92
- return null;
93
- }
94
- // Special case: pages directory - allow files in subdirectories
95
- // Direct page paths like pages/Foo.tsx will be caught by isDirectPagePath check
96
- if (firstDir === "pages") {
97
- return null;
98
- }
99
- return `Cannot operate on files in protected directory: ${firstDir}`;
100
- }
101
- // Check patterns
102
- if (matchesProtectedPattern(fileName)) {
103
- return `Cannot operate on protected file matching pattern: ${fileName}`;
104
- }
105
- return null;
106
- }
107
- /**
108
- * Validates a file operation against all applicable rules.
109
- *
110
- * @param operation - The type of file operation
111
- * @param relativePath - Relative path of the file
112
- * @param appRootDirPath - Application root directory
113
- * @param options - Optional validation options to override defaults
114
- * @throws FileValidationError if validation fails
115
- */
116
- export function validateFileOperation(operation, relativePath, appRootDirPath, options) {
117
- const opts = {
118
- ...DEFAULT_VALIDATION_OPTIONS[operation],
119
- ...options,
120
- };
121
- // Check blacklist
122
- if (opts.checkBlacklist) {
123
- const blacklistError = checkBlacklist(relativePath, appRootDirPath);
124
- if (blacklistError) {
125
- throw new FileValidationError(blacklistError, "BLACKLISTED");
126
- }
127
- }
128
- // Check API files
129
- if (!opts.allowApiFiles && isApiFilePath(relativePath)) {
130
- throw new FileValidationError(`Directly ${operation === "write" ? "writing to" : operation === "delete" ? "deleting" : "operating on"} API files is not allowed. Use the API interface instead.`, "API_FILE");
131
- }
132
- // Check scope files
133
- if (!opts.allowScopeFiles && isScopeFile(relativePath)) {
134
- throw new FileValidationError("Directly operating on scope files is not allowed. Use the appropriate tool.", "SCOPE_FILE");
135
- }
136
- // Check package.json
137
- if (!opts.allowPackageJson && isPackageJson(relativePath)) {
138
- throw new FileValidationError("Directly editing package.json is not allowed. Use the build_installPackages tool instead.", "PACKAGE_JSON");
139
- }
140
- // Check direct page paths
141
- if (!opts.allowDirectPagePath && isDirectPagePath(relativePath)) {
142
- throw new FileValidationError("Direct file creation in the pages directory is not allowed. Please create files within subdirectories (e.g., pages/yourFeature/index.tsx)", "DIRECT_PAGE");
143
- }
144
- }
145
- /**
146
- * Recursively checks if a directory contains any blacklisted content.
147
- *
148
- * @param entries - Directory entries to scan
149
- * @returns Error message if blacklisted content found, null otherwise
150
- */
151
- export function checkDirectoryContentBlacklist(entries) {
152
- for (const entry of entries) {
153
- const fileName = entry.name;
154
- // Check exact paths
155
- if (FILE_OPERATION_BLACKLIST.exactPaths.includes(fileName)) {
156
- return `Cannot remove protected file: ${fileName}`;
157
- }
158
- // Check protected directories
159
- if (entry.isDirectory &&
160
- FILE_OPERATION_BLACKLIST.directories.includes(fileName)) {
161
- return `Cannot remove protected directory: ${fileName}`;
162
- }
163
- // Check patterns
164
- if (matchesProtectedPattern(fileName)) {
165
- return `Cannot remove protected file matching pattern: ${fileName}`;
166
- }
167
- }
168
- return null;
169
- }
170
- //# sourceMappingURL=validation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAG3B,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAG1B;IAFlB,YACE,OAAe,EACC,IAOG;QAEnB,KAAK,CAAC,OAAO,CAAC,CAAC;QATC,SAAI,GAAJ,IAAI,CAOD;QAGnB,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,M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face for reading, writing, and listing files that may have
6
- * different physical representations.
7
- */
8
- import type { VirtualFileHandler, VirtualPathInfo, VirtualReadOptions, VirtualWriteOptions, VirtualDeleteOptions } from "./virtual-fs-types.js";
9
- /**
10
- * Manages virtual file handlers and routes operations to the appropriate handler.
11
- *
12
- * Usage:
13
- * ```typescript
14
- * const vfs = new VirtualFileSystem();
15
- * vfs.registerHandler(new ApiFileHandler());
16
- *
17
- * // Check if a path is virtual
18
- * if (vfs.isVirtualPath("apis/MyAPI.ts")) {
19
- * const content = await vfs.read("apis/MyAPI.ts", options);
20
- * }
21
- * ```
22
- */
23
- export declare class VirtualFileSystem {
24
- private handlers;
25
- /**
26
- * Register a handler for a type of virtual file.
27
- *
28
- * @param handler - The handler to register
29
- */
30
- registerHandler(handler: VirtualFileHandler): void;
31
- /**
32
- * Get all registered handlers.
33
- */
34
- getHandlers(): readonly VirtualFileHandler[];
35
- /**
36
- * Find the handler for a virtual path.
37
- *
38
- * @param virtualPath - The virtual path to look up
39
- * @returns The matching handler, or undefined if none match
40
- */
41
- getHandler(virtualPath: string): VirtualFileHandler | undefined;
42
- /**
43
- * Find the handler for a physical path.
44
- *
45
- * @param physicalPath - The physical path to look up
46
- * @returns The matching handler, or undefined if none match
47
- */
48
- getHandlerForPhysical(physicalPath: string): VirtualFileHandler | undefined;
49
- /**
50
- * Check if a path is a virtual path managed by any handler.
51
- *
52
- * @param path - The path to check
53
- * @returns true if any handler manages this path
54
- */
55
- isVirtualPath(path: string): boolean;
56
- /**
57
- * Parse a virtual path to extract metadata.
58
- *
59
- * @param virtualPath - The virtual path to parse
60
- * @returns Parsed info or undefined if not a virtual path
61
- */
62
- parse(virtualPath: string): VirtualPathInfo | undefined;
63
- /**
64
- * Convert a physical path to its virtual representation.
65
- *
66
- * @param physicalPath - The physical path to convert
67
- * @returns The virtual path, or the original path if not managed by any handler
68
- */
69
- toVirtualPath(physicalPath: string): string;
70
- /**
71
- * Convert a list of physical paths to virtual paths, deduplicating as needed.
72
- *
73
- * @param physicalPaths - The physical paths to convert
74
- * @returns Array of virtual paths (deduplicated)
75
- */
76
- toVirtualPaths(physicalPaths: string[]): string[];
77
- /**
78
- * Read content from a virtual file.
79
- *
80
- * @param virtualPath - The virtual path to read
81
- * @param options - Read options
82
- * @returns The file content, or undefined if not found or not a virtual path
83
- */
84
- read(virtualPath: string, options: VirtualReadOptions): Promise<string | undefined>;
85
- /**
86
- * Write content to a virtual file.
87
- *
88
- * @param virtualPath - The virtual path to write
89
- * @param content - The content to write
90
- * @param options - Write options
91
- * @throws Error if path is not managed by any handler
92
- */
93
- write(virtualPath: string, content: string, options: VirtualWriteOptions): Promise<void>;
94
- /**
95
- * Delete a virtual file.
96
- *
97
- * @param virtualPath - The virtual path to delete
98
- * @param options - Delete options
99
- * @returns List of physical paths that were deleted
100
- * @throws Error if path is not managed by any handler
101
- */
102
- delete(virtualPath: string, options: VirtualDeleteOptions): Promise<string[]>;
103
- }
104
- /**
105
- * Create a VirtualFileSystem with the default handlers registered.
106
- */
107
- export declare function createDefaultVirtualFileSystem(): VirtualFileSystem;
108
- //# sourceMappingURL=virtual-file-system.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-file-system.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/virtual-file-system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAA4B;IAE5C;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAIlD;;OAEG;IACH,WAAW,IAAI,SAAS,kBAAkB,EAAE;IAI5C;;;;;OAKG;IACH,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI/D;;;;;OAKG;IACH,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI3E;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpC;;;;;OAKG;IACH,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKvD;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAU3C;;;;;OAKG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAUjD;;;;;;OAMG;IACG,IAAI,CACR,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQ9B;;;;;;;OAOG;IACG,KAAK,CACT,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;;;;OAOG;IACG,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;CAOrB;AAED;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,iBAAiB,CAIlE"}
@@ -1,157 +0,0 @@
1
- /**
2
- * Virtual filesystem manager.
3
- *
4
- * Coordinates multiple virtual file handlers to provide a unified
5
- * interface for reading, writing, and listing files that may have
6
- * different physical representations.
7
- */
8
- import { ApiFileHandler } from "./handlers/api-handler.js";
9
- /**
10
- * Manages virtual file handlers and routes operations to the appropriate handler.
11
- *
12
- * Usage:
13
- * ```typescript
14
- * const vfs = new VirtualFileSystem();
15
- * vfs.registerHandler(new ApiFileHandler());
16
- *
17
- * // Check if a path is virtual
18
- * if (vfs.isVirtualPath("apis/MyAPI.ts")) {
19
- * const content = await vfs.read("apis/MyAPI.ts", options);
20
- * }
21
- * ```
22
- */
23
- export class VirtualFileSystem {
24
- handlers = [];
25
- /**
26
- * Register a handler for a type of virtual file.
27
- *
28
- * @param handler - The handler to register
29
- */
30
- registerHandler(handler) {
31
- this.handlers.push(handler);
32
- }
33
- /**
34
- * Get all registered handlers.
35
- */
36
- getHandlers() {
37
- return this.handlers;
38
- }
39
- /**
40
- * Find the handler for a virtual path.
41
- *
42
- * @param virtualPath - The virtual path to look up
43
- * @returns The matching handler, or undefined if none match
44
- */
45
- getHandler(virtualPath) {
46
- return this.handlers.find((h) => h.matches(virtualPath));
47
- }
48
- /**
49
- * Find the handler for a physical path.
50
- *
51
- * @param physicalPath - The physical path to look up
52
- * @returns The matching handler, or undefined if none match
53
- */
54
- getHandlerForPhysical(physicalPath) {
55
- return this.handlers.find((h) => h.matchesPhysical(physicalPath));
56
- }
57
- /**
58
- * Check if a path is a virtual path managed by any handler.
59
- *
60
- * @param path - The path to check
61
- * @returns true if any handler manages this path
62
- */
63
- isVirtualPath(path) {
64
- return this.handlers.some((h) => h.matches(path));
65
- }
66
- /**
67
- * Parse a virtual path to extract metadata.
68
- *
69
- * @param virtualPath - The virtual path to parse
70
- * @returns Parsed info or undefined if not a virtual path
71
- */
72
- parse(virtualPath) {
73
- const handler = this.getHandler(virtualPath);
74
- return handler?.parse(virtualPath);
75
- }
76
- /**
77
- * Convert a physical path to its virtual representation.
78
- *
79
- * @param physicalPath - The physical path to convert
80
- * @returns The virtual path, or the original path if not managed by any handler
81
- */
82
- toVirtualPath(physicalPath) {
83
- for (const handler of this.handlers) {
84
- const virtualPath = handler.toVirtualPath(physicalPath);
85
- if (virtualPath) {
86
- return virtualPath;
87
- }
88
- }
89
- return physicalPath;
90
- }
91
- /**
92
- * Convert a list of physical paths to virtual paths, deduplicating as needed.
93
- *
94
- * @param physicalPaths - The physical paths to convert
95
- * @returns Array of virtual paths (deduplicated)
96
- */
97
- toVirtualPaths(physicalPaths) {
98
- const virtualPaths = new Set();
99
- for (const physPath of physicalPaths) {
100
- virtualPaths.add(this.toVirtualPath(physPath));
101
- }
102
- return Array.from(virtualPaths);
103
- }
104
- /**
105
- * Read content from a virtual file.
106
- *
107
- * @param virtualPath - The virtual path to read
108
- * @param options - Read options
109
- * @returns The file content, or undefined if not found or not a virtual path
110
- */
111
- async read(virtualPath, options) {
112
- const handler = this.getHandler(virtualPath);
113
- if (!handler) {
114
- return undefined;
115
- }
116
- return await handler.read(virtualPath, options);
117
- }
118
- /**
119
- * Write content to a virtual file.
120
- *
121
- * @param virtualPath - The virtual path to write
122
- * @param content - The content to write
123
- * @param options - Write options
124
- * @throws Error if path is not managed by any handler
125
- */
126
- async write(virtualPath, content, options) {
127
- const handler = this.getHandler(virtualPath);
128
- if (!handler) {
129
- throw new Error(`No handler found for virtual path: ${virtualPath}`);
130
- }
131
- await handler.write(virtualPath, content, options);
132
- }
133
- /**
134
- * Delete a virtual file.
135
- *
136
- * @param virtualPath - The virtual path to delete
137
- * @param options - Delete options
138
- * @returns List of physical paths that were deleted
139
- * @throws Error if path is not managed by any handler
140
- */
141
- async delete(virtualPath, options) {
142
- const handler = this.getHandler(virtualPath);
143
- if (!handler) {
144
- throw new Error(`No handler found for virtual path: ${virtualPath}`);
145
- }
146
- return await handler.delete(virtualPath, options);
147
- }
148
- }
149
- /**
150
- * Create a VirtualFileSystem with the default handlers registered.
151
- */
152
- export function createDefaultVirtualFileSystem() {
153
- const vfs = new VirtualFileSystem();
154
- vfs.registerHandler(new ApiFileHandler());
155
- return vfs;
156
- }
157
- //# sourceMappingURL=virtual-file-system.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-file-system.js","sourceRoot":"","sources":["../../../../src/ai-service/app-interface/filesystem/virtual-file-system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IACpB,QAAQ,GAAyB,EAAE,CAAC;IAE5C;;;;OAIG;IACH,eAAe,CAAC,OAA2B;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