genaicode 0.8.6 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1003) hide show
  1. package/dist/ai-service/ai-studio.d.ts +2 -3
  2. package/dist/ai-service/ai-studio.js +55 -27
  3. package/dist/ai-service/ai-studio.js.map +1 -1
  4. package/dist/ai-service/anthropic.d.ts +2 -3
  5. package/dist/ai-service/anthropic.js +24 -8
  6. package/dist/ai-service/anthropic.js.map +1 -1
  7. package/dist/{src/ai-service/common.d.ts → ai-service/common-types.d.ts} +24 -26
  8. package/dist/ai-service/common-types.js +10 -0
  9. package/dist/ai-service/common-types.js.map +1 -0
  10. package/dist/ai-service/common.d.ts +3 -55
  11. package/dist/ai-service/common.js +16 -4
  12. package/dist/ai-service/common.js.map +1 -1
  13. package/dist/ai-service/dall-e.d.ts +2 -9
  14. package/dist/ai-service/dall-e.js +4 -11
  15. package/dist/ai-service/dall-e.js.map +1 -1
  16. package/dist/ai-service/openai.d.ts +15 -4
  17. package/dist/ai-service/openai.js +45 -20
  18. package/dist/ai-service/openai.js.map +1 -1
  19. package/dist/ai-service/service-configurations-types.d.ts +55 -0
  20. package/dist/ai-service/service-configurations-types.js +6 -0
  21. package/dist/ai-service/service-configurations-types.js.map +1 -0
  22. package/dist/ai-service/service-configurations.d.ts +3 -2
  23. package/dist/ai-service/service-configurations.js +5 -0
  24. package/dist/ai-service/service-configurations.js.map +1 -1
  25. package/dist/ai-service/unescape-function-call.d.ts +1 -1
  26. package/dist/ai-service/vertex-ai-claude.d.ts +2 -2
  27. package/dist/ai-service/vertex-ai-claude.js +22 -8
  28. package/dist/ai-service/vertex-ai-claude.js.map +1 -1
  29. package/dist/ai-service/vertex-ai-imagen.d.ts +2 -9
  30. package/dist/ai-service/vertex-ai-imagen.js +4 -11
  31. package/dist/ai-service/vertex-ai-imagen.js.map +1 -1
  32. package/dist/ai-service/vertex-ai.d.ts +2 -3
  33. package/dist/ai-service/vertex-ai.js +17 -12
  34. package/dist/ai-service/vertex-ai.js.map +1 -1
  35. package/dist/cli/cli-params.d.ts +1 -1
  36. package/dist/cli/cli-params.js +1 -1
  37. package/dist/cli/cli-params.js.map +1 -1
  38. package/dist/files/read-files.d.ts +1 -28
  39. package/dist/files/read-files.js +1 -1
  40. package/dist/files/read-files.js.map +1 -1
  41. package/dist/files/source-code-tree.d.ts +3 -1
  42. package/dist/files/source-code-tree.js.map +1 -1
  43. package/dist/files/source-code-types.d.ts +26 -0
  44. package/dist/files/source-code-types.js +2 -0
  45. package/dist/files/source-code-types.js.map +1 -0
  46. package/dist/files/summary-cache.d.ts +20 -0
  47. package/dist/files/summary-cache.js +15 -0
  48. package/dist/files/summary-cache.js.map +1 -0
  49. package/dist/files/update-files.d.ts +1 -1
  50. package/dist/help-docs/genaicode-help-document.d.ts +1 -0
  51. package/dist/help-docs/genaicode-help-document.js +286 -0
  52. package/dist/help-docs/genaicode-help-document.js.map +1 -0
  53. package/dist/index.d.ts +1 -3
  54. package/dist/index.js +1 -3
  55. package/dist/index.js.map +1 -1
  56. package/dist/main/codegen-types.d.ts +12 -10
  57. package/dist/main/codegen-utils.d.ts +1 -1
  58. package/dist/main/codegen.d.ts +4 -3
  59. package/dist/main/codegen.js.map +1 -1
  60. package/dist/main/codegen.test-utils.d.ts +1 -1
  61. package/dist/main/common/abort-controller.d.ts +2 -0
  62. package/dist/main/common/abort-controller.js +5 -0
  63. package/dist/main/common/abort-controller.js.map +1 -0
  64. package/dist/main/common/app-context-bus.d.ts +11 -0
  65. package/dist/main/common/app-context-bus.js +29 -0
  66. package/dist/main/common/app-context-bus.js.map +1 -0
  67. package/dist/main/common/content-bus-types.d.ts +1 -1
  68. package/dist/main/common/content-bus.d.ts +1 -1
  69. package/dist/main/common/cost-collector.d.ts +3 -2
  70. package/dist/main/common/cost-collector.js +3 -3
  71. package/dist/main/common/cost-collector.js.map +1 -1
  72. package/dist/main/common/user-actions.d.ts +3 -3
  73. package/dist/main/common/user-actions.js +17 -8
  74. package/dist/main/common/user-actions.js.map +1 -1
  75. package/dist/main/config-schema.js +10 -0
  76. package/dist/main/config-schema.js.map +1 -1
  77. package/dist/main/config-types.d.ts +22 -16
  78. package/dist/main/interactive/codegen-worker.d.ts +0 -1
  79. package/dist/main/interactive/codegen-worker.js +4 -3
  80. package/dist/main/interactive/codegen-worker.js.map +1 -1
  81. package/dist/main/interactive/select-ai-service.d.ts +1 -1
  82. package/dist/main/plugin-loader.d.ts +5 -3
  83. package/dist/main/plugin-loader.js.map +1 -1
  84. package/dist/main/ui/backend/endpoints/context-endpoint.js +67 -0
  85. package/dist/main/ui/backend/endpoints/context-endpoint.js.map +1 -0
  86. package/dist/main/ui/backend/endpoints/generate-content-endpoint.js +2 -1
  87. package/dist/main/ui/backend/endpoints/generate-content-endpoint.js.map +1 -1
  88. package/dist/main/ui/backend/endpoints/index.d.ts +1 -0
  89. package/dist/main/ui/backend/endpoints/index.js +1 -0
  90. package/dist/main/ui/backend/endpoints/index.js.map +1 -1
  91. package/dist/main/ui/backend/server.d.ts +2 -1
  92. package/dist/main/ui/backend/server.js +2 -1
  93. package/dist/main/ui/backend/server.js.map +1 -1
  94. package/dist/main/ui/backend/service.d.ts +29 -4
  95. package/dist/main/ui/backend/service.js +41 -3
  96. package/dist/main/ui/backend/service.js.map +1 -1
  97. package/dist/main/ui/codegen-ui.d.ts +5 -1
  98. package/dist/main/ui/codegen-ui.js +10 -1
  99. package/dist/main/ui/codegen-ui.js.map +1 -1
  100. package/dist/main/ui/common/api-types.d.ts +4 -51
  101. package/dist/main/ui/frontend/assets/favicon-DvroFOpS.png +0 -0
  102. package/dist/main/ui/frontend/assets/index-DfiFNFf2.js +1771 -0
  103. package/dist/main/ui/frontend/assets/wolf-bark-Bl17CX4O.mp3 +0 -0
  104. package/dist/main/ui/frontend/index.html +2 -2
  105. package/dist/operations/create-directory/create-directory-def.d.ts +1 -1
  106. package/dist/operations/create-file/create-file-def.d.ts +1 -1
  107. package/dist/operations/create-file/create-file-def.js +2 -1
  108. package/dist/operations/create-file/create-file-def.js.map +1 -1
  109. package/dist/operations/delete-file/delete-file-def.d.ts +1 -1
  110. package/dist/operations/download-file/download-file-def.d.ts +1 -1
  111. package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts +1 -1
  112. package/dist/operations/move-file/move-file-def.d.ts +1 -1
  113. package/dist/operations/patch-file/patch-file-def.d.ts +1 -1
  114. package/dist/operations/patch-file/patch-file-def.js +2 -1
  115. package/dist/operations/patch-file/patch-file-def.js.map +1 -1
  116. package/dist/operations/resize-image/resize-image-def.d.ts +1 -1
  117. package/dist/operations/split-image/split-image-def.d.ts +1 -1
  118. package/dist/operations/update-file/update-file-def.d.ts +1 -1
  119. package/dist/operations/update-file/update-file-def.js +2 -1
  120. package/dist/operations/update-file/update-file-def.js.map +1 -1
  121. package/dist/prompt/ai-service-fallback.d.ts +4 -3
  122. package/dist/prompt/ai-service-fallback.js +10 -58
  123. package/dist/prompt/ai-service-fallback.js.map +1 -1
  124. package/dist/prompt/function-calling-validate.d.ts +2 -2
  125. package/dist/prompt/function-calling-validate.js +4 -5
  126. package/dist/prompt/function-calling-validate.js.map +1 -1
  127. package/dist/prompt/function-calling.d.ts +1 -1
  128. package/dist/prompt/function-calling.js +12 -2
  129. package/dist/prompt/function-calling.js.map +1 -1
  130. package/dist/prompt/function-defs/analysis-result.d.ts +7 -0
  131. package/dist/prompt/function-defs/analysis-result.js +24 -0
  132. package/dist/prompt/function-defs/analysis-result.js.map +1 -0
  133. package/dist/prompt/function-defs/ask-question.d.ts +3 -2
  134. package/dist/prompt/function-defs/ask-question.js +93 -81
  135. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  136. package/dist/prompt/function-defs/codegen-planning.d.ts +1 -1
  137. package/dist/prompt/function-defs/codegen-planning.js +11 -1
  138. package/dist/prompt/function-defs/codegen-planning.js.map +1 -1
  139. package/dist/prompt/function-defs/codegen-summary.d.ts +1 -1
  140. package/dist/prompt/function-defs/codegen-summary.js +19 -10
  141. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  142. package/dist/prompt/function-defs/explanation.d.ts +1 -1
  143. package/dist/prompt/function-defs/genaicode-help.d.ts +6 -0
  144. package/dist/prompt/function-defs/genaicode-help.js +23 -0
  145. package/dist/prompt/function-defs/genaicode-help.js.map +1 -0
  146. package/dist/prompt/function-defs/generate-image.d.ts +1 -1
  147. package/dist/prompt/function-defs/get-image-assets.d.ts +1 -1
  148. package/dist/prompt/function-defs/get-source-code.d.ts +1 -1
  149. package/dist/prompt/function-defs/optimize-context.d.ts +1 -1
  150. package/dist/prompt/function-defs/optimize-context.js +1 -1
  151. package/dist/prompt/function-defs/optimize-context.js.map +1 -1
  152. package/dist/prompt/function-defs/perform-analysis.d.ts +8 -0
  153. package/dist/prompt/function-defs/perform-analysis.js +28 -0
  154. package/dist/prompt/function-defs/perform-analysis.js.map +1 -0
  155. package/dist/prompt/function-defs/read-history.d.ts +1 -1
  156. package/dist/prompt/function-defs/reasoning-inference.d.ts +3 -0
  157. package/dist/prompt/function-defs/reasoning-inference.js +39 -0
  158. package/dist/prompt/function-defs/reasoning-inference.js.map +1 -0
  159. package/dist/prompt/function-defs/set-summaries.d.ts +1 -1
  160. package/dist/prompt/function-defs/update-history.d.ts +1 -1
  161. package/dist/prompt/limits.js +1 -1
  162. package/dist/prompt/prompt-service.d.ts +5 -2
  163. package/dist/prompt/prompt-service.js +1 -2
  164. package/dist/prompt/prompt-service.js.map +1 -1
  165. package/dist/prompt/prompt-service.test-utils.d.ts +2 -2
  166. package/dist/prompt/prompt-service.test-utils.js +2 -1
  167. package/dist/prompt/prompt-service.test-utils.js.map +1 -1
  168. package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts +2 -0
  169. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +11 -9
  170. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -1
  171. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +1 -5
  172. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -1
  173. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +1 -5
  174. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -1
  175. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.d.ts +1 -0
  176. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js +251 -0
  177. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js.map +1 -0
  178. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.d.ts +2 -0
  179. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js +157 -0
  180. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js.map +1 -0
  181. package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.d.ts +2 -0
  182. package/dist/prompt/steps/step-ask-question/handlers/{cancel-code-generation.js → handle-end-conversation.js} +2 -2
  183. package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js.map +1 -0
  184. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.d.ts +8 -0
  185. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js +91 -0
  186. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js.map +1 -0
  187. package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.d.ts +2 -0
  188. package/dist/prompt/steps/step-ask-question/handlers/{handle-send-message-with-image.js → handle-generate-image.js} +28 -29
  189. package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js.map +1 -0
  190. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.d.ts +6 -0
  191. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js +99 -0
  192. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js.map +1 -0
  193. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.d.ts +9 -0
  194. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js +90 -0
  195. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js.map +1 -0
  196. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.d.ts +9 -0
  197. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js +91 -0
  198. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js.map +1 -0
  199. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.d.ts +7 -0
  200. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js +87 -0
  201. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js.map +1 -0
  202. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +4 -4
  203. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js.map +1 -1
  204. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +1 -4
  205. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -1
  206. package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js +92 -61
  207. package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js.map +1 -1
  208. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +2 -1
  209. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -1
  210. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +7 -1
  211. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +42 -42
  212. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -1
  213. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +3 -2
  214. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -1
  215. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +75 -6
  216. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +5 -1
  217. package/dist/prompt/steps/step-ask-question/step-ask-question.js +30 -13
  218. package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
  219. package/dist/prompt/steps/step-codegen-planning.d.ts +2 -1
  220. package/dist/prompt/steps/step-codegen-planning.js +2 -1
  221. package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
  222. package/dist/prompt/steps/step-context-optimization.d.ts +2 -1
  223. package/dist/prompt/steps/step-context-optimization.js +5 -7
  224. package/dist/prompt/steps/step-context-optimization.js.map +1 -1
  225. package/dist/prompt/steps/step-ensure-context.d.ts +1 -1
  226. package/dist/prompt/steps/step-ensure-context.js +3 -0
  227. package/dist/prompt/steps/step-ensure-context.js.map +1 -1
  228. package/dist/prompt/steps/step-generate-codegen-summary-prompt.d.ts +2 -0
  229. package/dist/prompt/steps/step-generate-codegen-summary-prompt.js +133 -0
  230. package/dist/prompt/steps/step-generate-codegen-summary-prompt.js.map +1 -0
  231. package/dist/prompt/steps/step-generate-codegen-summary.d.ts +6 -3
  232. package/dist/prompt/steps/step-generate-codegen-summary.js +14 -2
  233. package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -1
  234. package/dist/prompt/steps/step-generate-image.d.ts +2 -1
  235. package/dist/prompt/steps/step-generate-image.js +4 -2
  236. package/dist/prompt/steps/step-generate-image.js.map +1 -1
  237. package/dist/prompt/steps/step-generate-summary.d.ts +2 -1
  238. package/dist/prompt/steps/step-generate-summary.js +3 -2
  239. package/dist/prompt/steps/step-generate-summary.js.map +1 -1
  240. package/dist/prompt/steps/step-history-update.d.ts +2 -1
  241. package/dist/prompt/steps/step-history-update.js +9 -1
  242. package/dist/prompt/steps/step-history-update.js.map +1 -1
  243. package/dist/prompt/steps/step-process-file-updates.d.ts +7 -3
  244. package/dist/prompt/steps/step-process-file-updates.js +9 -7
  245. package/dist/prompt/steps/step-process-file-updates.js.map +1 -1
  246. package/dist/prompt/steps/step-summarization.d.ts +2 -6
  247. package/dist/prompt/steps/step-summarization.js +11 -15
  248. package/dist/prompt/steps/step-summarization.js.map +1 -1
  249. package/dist/prompt/steps/step-validate-recover.d.ts +4 -2
  250. package/dist/prompt/steps/step-validate-recover.js +8 -6
  251. package/dist/prompt/steps/step-validate-recover.js.map +1 -1
  252. package/dist/prompt/steps/step-verify-patch.d.ts +4 -1
  253. package/dist/prompt/steps/step-verify-patch.js +15 -2
  254. package/dist/prompt/steps/step-verify-patch.js.map +1 -1
  255. package/dist/prompt/steps/steps-types.d.ts +0 -14
  256. package/dist/prompt/steps/steps-types.js.map +1 -1
  257. package/dist/prompt/steps/steps-utils.d.ts +1 -1
  258. package/dist/prompt/systemprompt.d.ts +1 -1
  259. package/dist/prompt/systemprompt.js +40 -11
  260. package/dist/prompt/systemprompt.js.map +1 -1
  261. package/dist/{eval → prompt-debug}/current-prompt-plugin.d.ts +1 -1
  262. package/dist/{eval → prompt-debug}/current-prompt-plugin.js +1 -1
  263. package/dist/prompt-debug/current-prompt-plugin.js.map +1 -0
  264. package/dist/vite-genaicode/vite-genaicode-context.d.ts +31 -0
  265. package/dist/vite-genaicode/vite-genaicode-context.js +120 -0
  266. package/dist/vite-genaicode/vite-genaicode-context.js.map +1 -0
  267. package/dist/vite-genaicode/vite-genaicode-frontend.js +206 -30
  268. package/dist/vite-genaicode/vite-genaicode-frontend.js.map +1 -1
  269. package/dist/vite-genaicode/vite-genaicode-plugin.d.ts +1 -0
  270. package/dist/vite-genaicode/vite-genaicode-plugin.js +22 -9
  271. package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
  272. package/dist/vite-genaicode/vite-genaicode-types.d.ts +26 -0
  273. package/dist/vite-genaicode/vite-genaicode-types.js +11 -0
  274. package/dist/vite-genaicode/vite-genaicode-types.js.map +1 -0
  275. package/package.json +10 -3
  276. package/dist/ai-service/ai-studio.d.ts.map +0 -1
  277. package/dist/ai-service/anthropic.d.ts.map +0 -1
  278. package/dist/ai-service/chat-gpt.d.ts +0 -7
  279. package/dist/ai-service/chat-gpt.d.ts.map +0 -1
  280. package/dist/ai-service/chat-gpt.js +0 -174
  281. package/dist/ai-service/chat-gpt.js.map +0 -1
  282. package/dist/ai-service/common.d.ts.map +0 -1
  283. package/dist/ai-service/common.test.js +0 -86
  284. package/dist/ai-service/common.test.js.map +0 -1
  285. package/dist/ai-service/dall-e.d.ts.map +0 -1
  286. package/dist/ai-service/unescape-function-call.d.ts.map +0 -1
  287. package/dist/ai-service/unescape-function-call.test.d.ts +0 -1
  288. package/dist/ai-service/unescape-function-call.test.js +0 -18
  289. package/dist/ai-service/unescape-function-call.test.js.map +0 -1
  290. package/dist/ai-service/vertex-ai-claude.d.ts.map +0 -1
  291. package/dist/ai-service/vertex-ai-imagen.d.ts.map +0 -1
  292. package/dist/ai-service/vertex-ai.d.ts.map +0 -1
  293. package/dist/cli/cli-options.d.ts.map +0 -1
  294. package/dist/cli/cli-options.test.d.ts +0 -1
  295. package/dist/cli/cli-options.test.js +0 -34
  296. package/dist/cli/cli-options.test.js.map +0 -1
  297. package/dist/cli/cli-params.d.ts.map +0 -1
  298. package/dist/cli/cli-params.test.d.ts +0 -1
  299. package/dist/cli/cli-params.test.js +0 -38
  300. package/dist/cli/cli-params.test.js.map +0 -1
  301. package/dist/cli/service-autodetect.d.ts.map +0 -1
  302. package/dist/cli/service-autodetect.test.d.ts +0 -1
  303. package/dist/cli/service-autodetect.test.js +0 -38
  304. package/dist/cli/service-autodetect.test.js.map +0 -1
  305. package/dist/cli/validate-cli-params.d.ts.map +0 -1
  306. package/dist/cli/validate-cli-params.test.d.ts +0 -1
  307. package/dist/cli/validate-cli-params.test.js +0 -106
  308. package/dist/cli/validate-cli-params.test.js.map +0 -1
  309. package/dist/eval/codegen-summary.test.d.ts +0 -1
  310. package/dist/eval/codegen-summary.test.js +0 -93
  311. package/dist/eval/codegen-summary.test.js.map +0 -1
  312. package/dist/eval/current-prompt-plugin.js.map +0 -1
  313. package/dist/eval/data/current-prompt.d.ts +0 -149
  314. package/dist/eval/data/current-prompt.js +0 -314
  315. package/dist/eval/data/current-prompt.js.map +0 -1
  316. package/dist/eval/data/prompt-assistant-image.d.ts +0 -49
  317. package/dist/eval/data/prompt-assistant-image.js +0 -67
  318. package/dist/eval/data/prompt-assistant-image.js.map +0 -1
  319. package/dist/eval/data/prompt3.d.ts +0 -34
  320. package/dist/eval/data/prompt3.js +0 -71
  321. package/dist/eval/data/prompt3.js.map +0 -1
  322. package/dist/eval/prompt-debug.test.d.ts +0 -1
  323. package/dist/eval/prompt-debug.test.js +0 -93
  324. package/dist/eval/prompt-debug.test.js.map +0 -1
  325. package/dist/eval/prompt2.d.ts +0 -34
  326. package/dist/eval/prompt2.js +0 -125
  327. package/dist/eval/prompt2.js.map +0 -1
  328. package/dist/examples/genaicode_plugins/fake_ai_service.d.ts +0 -3
  329. package/dist/examples/genaicode_plugins/fake_ai_service.js +0 -11
  330. package/dist/examples/genaicode_plugins/fake_ai_service.js.map +0 -1
  331. package/dist/examples/genaicode_plugins/grok_ai_service.d.ts +0 -3
  332. package/dist/examples/genaicode_plugins/grok_ai_service.js +0 -153
  333. package/dist/examples/genaicode_plugins/grok_ai_service.js.map +0 -1
  334. package/dist/examples/genaicode_plugins/nonsense_operation.d.ts +0 -3
  335. package/dist/examples/genaicode_plugins/nonsense_operation.js +0 -23
  336. package/dist/examples/genaicode_plugins/nonsense_operation.js.map +0 -1
  337. package/dist/files/cache-file.d.ts.map +0 -1
  338. package/dist/files/file-utils.d.ts.map +0 -1
  339. package/dist/files/file-utils.test.d.ts +0 -1
  340. package/dist/files/file-utils.test.js +0 -18
  341. package/dist/files/file-utils.test.js.map +0 -1
  342. package/dist/files/find-files.d.ts.map +0 -1
  343. package/dist/files/path-utils.d.ts.map +0 -1
  344. package/dist/files/read-files.d.ts.map +0 -1
  345. package/dist/files/read-files.test.d.ts +0 -1
  346. package/dist/files/read-files.test.js +0 -95
  347. package/dist/files/read-files.test.js.map +0 -1
  348. package/dist/files/search-files.d.ts.map +0 -1
  349. package/dist/files/source-code-tree.d.ts.map +0 -1
  350. package/dist/files/temp-buffer.d.ts.map +0 -1
  351. package/dist/files/update-files.d.ts.map +0 -1
  352. package/dist/images/ensure-alpha.d.ts.map +0 -1
  353. package/dist/images/imgly-remove-background.d.ts.map +0 -1
  354. package/dist/images/resize-image.d.ts.map +0 -1
  355. package/dist/images/split-image.d.ts.map +0 -1
  356. package/dist/index.d.ts.map +0 -1
  357. package/dist/main/codegen-non-interactive.d.ts.map +0 -1
  358. package/dist/main/codegen-types.d.ts.map +0 -1
  359. package/dist/main/codegen-utils.d.ts.map +0 -1
  360. package/dist/main/codegen.ai-services.test.d.ts +0 -3
  361. package/dist/main/codegen.ai-services.test.js +0 -198
  362. package/dist/main/codegen.ai-services.test.js.map +0 -1
  363. package/dist/main/codegen.cli-options.test.d.ts +0 -3
  364. package/dist/main/codegen.cli-options.test.js +0 -171
  365. package/dist/main/codegen.cli-options.test.js.map +0 -1
  366. package/dist/main/codegen.d.ts.map +0 -1
  367. package/dist/main/codegen.image-generation.test.d.ts +0 -3
  368. package/dist/main/codegen.image-generation.test.js +0 -187
  369. package/dist/main/codegen.image-generation.test.js.map +0 -1
  370. package/dist/main/codegen.test-utils.d.ts.map +0 -1
  371. package/dist/main/codegen.test.d.ts +0 -3
  372. package/dist/main/codegen.test.js +0 -307
  373. package/dist/main/codegen.test.js.map +0 -1
  374. package/dist/main/common/content-bus-types.d.ts.map +0 -1
  375. package/dist/main/common/content-bus.d.ts.map +0 -1
  376. package/dist/main/common/cost-collector.d.ts.map +0 -1
  377. package/dist/main/common/user-actions.d.ts.map +0 -1
  378. package/dist/main/config-lib.d.ts.map +0 -1
  379. package/dist/main/config-lib.test.d.ts +0 -1
  380. package/dist/main/config-lib.test.js +0 -64
  381. package/dist/main/config-lib.test.js.map +0 -1
  382. package/dist/main/config.d.ts.map +0 -1
  383. package/dist/main/interactive/codegen-interactive.d.ts.map +0 -1
  384. package/dist/main/interactive/codegen-interactive.test.d.ts +0 -5
  385. package/dist/main/interactive/codegen-interactive.test.js +0 -73
  386. package/dist/main/interactive/codegen-interactive.test.js.map +0 -1
  387. package/dist/main/interactive/codegen-worker.d.ts.map +0 -1
  388. package/dist/main/interactive/common.d.ts.map +0 -1
  389. package/dist/main/interactive/configure.d.ts.map +0 -1
  390. package/dist/main/interactive/error-handling.d.ts.map +0 -1
  391. package/dist/main/interactive/help.d.ts.map +0 -1
  392. package/dist/main/interactive/process-comments.d.ts +0 -2
  393. package/dist/main/interactive/process-comments.js +0 -39
  394. package/dist/main/interactive/process-comments.js.map +0 -1
  395. package/dist/main/interactive/select-ai-service.d.ts.map +0 -1
  396. package/dist/main/interactive/task-file.d.ts.map +0 -1
  397. package/dist/main/interactive/text-prompt.d.ts.map +0 -1
  398. package/dist/main/interactive/user-action-handlers.d.ts.map +0 -1
  399. package/dist/main/interactive/user-interrupt.d.ts.map +0 -1
  400. package/dist/main/plugin-loader.d.ts.map +0 -1
  401. package/dist/main/ui/backend/api-utils.d.ts.map +0 -1
  402. package/dist/main/ui/backend/api.d.ts.map +0 -1
  403. package/dist/main/ui/backend/server.d.ts.map +0 -1
  404. package/dist/main/ui/backend/service.d.ts.map +0 -1
  405. package/dist/main/ui/codegen-ui.d.ts.map +0 -1
  406. package/dist/main/ui/common/api-types.d.ts.map +0 -1
  407. package/dist/main/ui/frontend/assets/index-BAAQr5b1.js +0 -1747
  408. package/dist/main/ui/user-action-handlers.d.ts.map +0 -1
  409. package/dist/operations/create-directory/create-directory-def.d.ts.map +0 -1
  410. package/dist/operations/create-directory/create-directory-executor.d.ts.map +0 -1
  411. package/dist/operations/create-file/create-file-def.d.ts.map +0 -1
  412. package/dist/operations/create-file/create-file-executor.d.ts.map +0 -1
  413. package/dist/operations/delete-file/delete-file-def.d.ts.map +0 -1
  414. package/dist/operations/delete-file/delete-file-executor.d.ts.map +0 -1
  415. package/dist/operations/download-file/download-file-def.d.ts.map +0 -1
  416. package/dist/operations/download-file/download-file-executor.d.ts.map +0 -1
  417. package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts.map +0 -1
  418. package/dist/operations/imgly-remove-background/imgly-remove-background-executor.d.ts.map +0 -1
  419. package/dist/operations/move-file/move-file-def.d.ts.map +0 -1
  420. package/dist/operations/move-file/move-file-executor.d.ts.map +0 -1
  421. package/dist/operations/operations-index.d.ts.map +0 -1
  422. package/dist/operations/patch-file/patch-file-def.d.ts.map +0 -1
  423. package/dist/operations/patch-file/patch-file-executor.d.ts.map +0 -1
  424. package/dist/operations/resize-image/resize-image-def.d.ts.map +0 -1
  425. package/dist/operations/resize-image/resize-image-executor.d.ts.map +0 -1
  426. package/dist/operations/split-image/split-image-def.d.ts.map +0 -1
  427. package/dist/operations/split-image/split-image-executor.d.ts.map +0 -1
  428. package/dist/operations/update-file/update-file-def.d.ts.map +0 -1
  429. package/dist/operations/update-file/update-file-executor.d.ts.map +0 -1
  430. package/dist/project-profiles/detection.d.ts.map +0 -1
  431. package/dist/project-profiles/index.d.ts.map +0 -1
  432. package/dist/project-profiles/profiles/golang.d.ts.map +0 -1
  433. package/dist/project-profiles/profiles/java-maven.d.ts.map +0 -1
  434. package/dist/project-profiles/profiles/javascript-npm.d.ts.map +0 -1
  435. package/dist/project-profiles/profiles/javascript-react.d.ts.map +0 -1
  436. package/dist/project-profiles/profiles/python-django.d.ts.map +0 -1
  437. package/dist/project-profiles/types.d.ts.map +0 -1
  438. package/dist/prompt/ai-service-fallback.d.ts.map +0 -1
  439. package/dist/prompt/function-calling-validate.d.ts.map +0 -1
  440. package/dist/prompt/function-calling.d.ts.map +0 -1
  441. package/dist/prompt/function-defs/ask-question-reflect.d.ts +0 -2
  442. package/dist/prompt/function-defs/ask-question-reflect.js +0 -21
  443. package/dist/prompt/function-defs/ask-question-reflect.js.map +0 -1
  444. package/dist/prompt/function-defs/ask-question.d.ts.map +0 -1
  445. package/dist/prompt/function-defs/codegen-planning.d.ts.map +0 -1
  446. package/dist/prompt/function-defs/codegen-summary.d.ts.map +0 -1
  447. package/dist/prompt/function-defs/create-directory.d.ts +0 -21
  448. package/dist/prompt/function-defs/create-directory.js +0 -22
  449. package/dist/prompt/function-defs/create-directory.js.map +0 -1
  450. package/dist/prompt/function-defs/create-file.d.ts +0 -25
  451. package/dist/prompt/function-defs/create-file.js +0 -26
  452. package/dist/prompt/function-defs/create-file.js.map +0 -1
  453. package/dist/prompt/function-defs/delete-file.d.ts +0 -21
  454. package/dist/prompt/function-defs/delete-file.js +0 -22
  455. package/dist/prompt/function-defs/delete-file.js.map +0 -1
  456. package/dist/prompt/function-defs/download-file.d.ts +0 -25
  457. package/dist/prompt/function-defs/download-file.js +0 -26
  458. package/dist/prompt/function-defs/download-file.js.map +0 -1
  459. package/dist/prompt/function-defs/explanation.d.ts.map +0 -1
  460. package/dist/prompt/function-defs/generate-image.d.ts.map +0 -1
  461. package/dist/prompt/function-defs/get-image-assets.d.ts.map +0 -1
  462. package/dist/prompt/function-defs/get-source-code.d.ts.map +0 -1
  463. package/dist/prompt/function-defs/imgly-remove-background.d.ts +0 -25
  464. package/dist/prompt/function-defs/imgly-remove-background.js +0 -26
  465. package/dist/prompt/function-defs/imgly-remove-background.js.map +0 -1
  466. package/dist/prompt/function-defs/move-file.d.ts +0 -25
  467. package/dist/prompt/function-defs/move-file.js +0 -26
  468. package/dist/prompt/function-defs/move-file.js.map +0 -1
  469. package/dist/prompt/function-defs/optimize-context.d.ts.map +0 -1
  470. package/dist/prompt/function-defs/patch-file.d.ts +0 -25
  471. package/dist/prompt/function-defs/patch-file.js +0 -39
  472. package/dist/prompt/function-defs/patch-file.js.map +0 -1
  473. package/dist/prompt/function-defs/read-history.d.ts.map +0 -1
  474. package/dist/prompt/function-defs/resize-image.d.ts +0 -36
  475. package/dist/prompt/function-defs/resize-image.js +0 -37
  476. package/dist/prompt/function-defs/resize-image.js.map +0 -1
  477. package/dist/prompt/function-defs/set-summaries.d.ts.map +0 -1
  478. package/dist/prompt/function-defs/split-image.d.ts +0 -57
  479. package/dist/prompt/function-defs/split-image.js +0 -46
  480. package/dist/prompt/function-defs/split-image.js.map +0 -1
  481. package/dist/prompt/function-defs/update-file.d.ts +0 -25
  482. package/dist/prompt/function-defs/update-file.js +0 -26
  483. package/dist/prompt/function-defs/update-file.js.map +0 -1
  484. package/dist/prompt/function-defs/update-history.d.ts.map +0 -1
  485. package/dist/prompt/limits.d.ts.map +0 -1
  486. package/dist/prompt/limits.test.d.ts +0 -1
  487. package/dist/prompt/limits.test.js +0 -35
  488. package/dist/prompt/limits.test.js.map +0 -1
  489. package/dist/prompt/prompt-codegen.d.ts.map +0 -1
  490. package/dist/prompt/prompt-codegen.test.d.ts +0 -1
  491. package/dist/prompt/prompt-codegen.test.js +0 -92
  492. package/dist/prompt/prompt-codegen.test.js.map +0 -1
  493. package/dist/prompt/prompt-consts.d.ts +0 -1
  494. package/dist/prompt/prompt-consts.js +0 -2
  495. package/dist/prompt/prompt-consts.js.map +0 -1
  496. package/dist/prompt/prompt-service-ask-question.test.d.ts +0 -4
  497. package/dist/prompt/prompt-service-ask-question.test.js +0 -162
  498. package/dist/prompt/prompt-service-ask-question.test.js.map +0 -1
  499. package/dist/prompt/prompt-service.ai-services.test.d.ts +0 -1
  500. package/dist/prompt/prompt-service.ai-services.test.js +0 -149
  501. package/dist/prompt/prompt-service.ai-services.test.js.map +0 -1
  502. package/dist/prompt/prompt-service.context-optimization.test.d.ts +0 -1
  503. package/dist/prompt/prompt-service.context-optimization.test.js +0 -212
  504. package/dist/prompt/prompt-service.context-optimization.test.js.map +0 -1
  505. package/dist/prompt/prompt-service.d.ts.map +0 -1
  506. package/dist/prompt/prompt-service.image-handling.test.d.ts +0 -1
  507. package/dist/prompt/prompt-service.image-handling.test.js +0 -212
  508. package/dist/prompt/prompt-service.image-handling.test.js.map +0 -1
  509. package/dist/prompt/prompt-service.test-utils.d.ts.map +0 -1
  510. package/dist/prompt/prompt-service.test.d.ts +0 -2
  511. package/dist/prompt/prompt-service.test.js +0 -629
  512. package/dist/prompt/prompt-service.test.js.map +0 -1
  513. package/dist/prompt/prompt-service.validation-recovery.test.d.ts +0 -1
  514. package/dist/prompt/prompt-service.validation-recovery.test.js +0 -263
  515. package/dist/prompt/prompt-service.validation-recovery.test.js.map +0 -1
  516. package/dist/prompt/static-prompts.d.ts.map +0 -1
  517. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
  518. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts.map +0 -1
  519. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
  520. package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts.map +0 -1
  521. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts.map +0 -1
  522. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts.map +0 -1
  523. package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
  524. package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts.map +0 -1
  525. package/dist/prompt/steps/step-ask-question/handlers/default-action.js +0 -15
  526. package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
  527. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.d.ts +0 -2
  528. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js +0 -86
  529. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js.map +0 -1
  530. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
  531. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
  532. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
  533. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts.map +0 -1
  534. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts +0 -2
  535. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts.map +0 -1
  536. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js.map +0 -1
  537. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts.map +0 -1
  538. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.d.ts +0 -0
  539. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js +0 -2
  540. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js.map +0 -1
  541. package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts.map +0 -1
  542. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts.map +0 -1
  543. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts.map +0 -1
  544. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts.map +0 -1
  545. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
  546. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
  547. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
  548. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  549. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
  550. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
  551. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
  552. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -92
  553. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
  554. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts.map +0 -1
  555. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts.map +0 -1
  556. package/dist/prompt/steps/step-ask-question-handlers.d.ts +0 -10
  557. package/dist/prompt/steps/step-ask-question-handlers.js +0 -257
  558. package/dist/prompt/steps/step-ask-question-handlers.js.map +0 -1
  559. package/dist/prompt/steps/step-ask-question-reflect.d.ts +0 -4
  560. package/dist/prompt/steps/step-ask-question-reflect.js +0 -48
  561. package/dist/prompt/steps/step-ask-question-reflect.js.map +0 -1
  562. package/dist/prompt/steps/step-ask-question-types.d.ts +0 -55
  563. package/dist/prompt/steps/step-ask-question-types.js +0 -2
  564. package/dist/prompt/steps/step-ask-question-types.js.map +0 -1
  565. package/dist/prompt/steps/step-ask-question.d.ts +0 -6
  566. package/dist/prompt/steps/step-ask-question.js +0 -80
  567. package/dist/prompt/steps/step-ask-question.js.map +0 -1
  568. package/dist/prompt/steps/step-codegen-planning.d.ts.map +0 -1
  569. package/dist/prompt/steps/step-codegen-summary.d.ts +0 -7
  570. package/dist/prompt/steps/step-codegen-summary.d.ts.map +0 -1
  571. package/dist/prompt/steps/step-codegen-summary.js +0 -106
  572. package/dist/prompt/steps/step-codegen-summary.js.map +0 -1
  573. package/dist/prompt/steps/step-codegen-summary.test.d.ts +0 -1
  574. package/dist/prompt/steps/step-codegen-summary.test.js +0 -136
  575. package/dist/prompt/steps/step-codegen-summary.test.js.map +0 -1
  576. package/dist/prompt/steps/step-context-optimization.d.ts.map +0 -1
  577. package/dist/prompt/steps/step-context-optimization.test.d.ts +0 -2
  578. package/dist/prompt/steps/step-context-optimization.test.js +0 -475
  579. package/dist/prompt/steps/step-context-optimization.test.js.map +0 -1
  580. package/dist/prompt/steps/step-ensure-context.d.ts.map +0 -1
  581. package/dist/prompt/steps/step-ensure-context.test.d.ts +0 -1
  582. package/dist/prompt/steps/step-ensure-context.test.js +0 -326
  583. package/dist/prompt/steps/step-ensure-context.test.js.map +0 -1
  584. package/dist/prompt/steps/step-generate-image.d.ts.map +0 -1
  585. package/dist/prompt/steps/step-generate-summary.d.ts.map +0 -1
  586. package/dist/prompt/steps/step-history-update.d.ts.map +0 -1
  587. package/dist/prompt/steps/step-summarization.d.ts.map +0 -1
  588. package/dist/prompt/steps/step-validate-recover.d.ts.map +0 -1
  589. package/dist/prompt/steps/step-verify-patch.d.ts.map +0 -1
  590. package/dist/prompt/steps/steps-types.d.ts.map +0 -1
  591. package/dist/prompt/steps/steps-utils.d.ts.map +0 -1
  592. package/dist/prompt/systemprompt.d.ts.map +0 -1
  593. package/dist/prompt/systemprompt.test.d.ts +0 -3
  594. package/dist/prompt/systemprompt.test.js +0 -42
  595. package/dist/prompt/systemprompt.test.js.map +0 -1
  596. package/dist/prompt/token-estimator.d.ts.map +0 -1
  597. package/dist/src/ai-service/ai-studio.d.ts +0 -6
  598. package/dist/src/ai-service/ai-studio.js +0 -190
  599. package/dist/src/ai-service/ai-studio.js.map +0 -1
  600. package/dist/src/ai-service/anthropic.d.ts +0 -6
  601. package/dist/src/ai-service/anthropic.js +0 -150
  602. package/dist/src/ai-service/anthropic.js.map +0 -1
  603. package/dist/src/ai-service/chat-gpt.d.ts +0 -5
  604. package/dist/src/ai-service/chat-gpt.js +0 -146
  605. package/dist/src/ai-service/chat-gpt.js.map +0 -1
  606. package/dist/src/ai-service/common.js +0 -38
  607. package/dist/src/ai-service/common.js.map +0 -1
  608. package/dist/src/ai-service/common.test.d.ts +0 -1
  609. package/dist/src/ai-service/common.test.js +0 -86
  610. package/dist/src/ai-service/common.test.js.map +0 -1
  611. package/dist/src/ai-service/dall-e.d.ts +0 -14
  612. package/dist/src/ai-service/dall-e.js +0 -50
  613. package/dist/src/ai-service/dall-e.js.map +0 -1
  614. package/dist/src/ai-service/unescape-function-call.d.ts +0 -7
  615. package/dist/src/ai-service/unescape-function-call.js +0 -59
  616. package/dist/src/ai-service/unescape-function-call.js.map +0 -1
  617. package/dist/src/ai-service/unescape-function-call.test.d.ts +0 -1
  618. package/dist/src/ai-service/unescape-function-call.test.js +0 -18
  619. package/dist/src/ai-service/unescape-function-call.test.js.map +0 -1
  620. package/dist/src/ai-service/vertex-ai-claude.d.ts +0 -5
  621. package/dist/src/ai-service/vertex-ai-claude.js +0 -104
  622. package/dist/src/ai-service/vertex-ai-claude.js.map +0 -1
  623. package/dist/src/ai-service/vertex-ai-imagen.d.ts +0 -14
  624. package/dist/src/ai-service/vertex-ai-imagen.js +0 -77
  625. package/dist/src/ai-service/vertex-ai-imagen.js.map +0 -1
  626. package/dist/src/ai-service/vertex-ai.d.ts +0 -6
  627. package/dist/src/ai-service/vertex-ai.js +0 -202
  628. package/dist/src/ai-service/vertex-ai.js.map +0 -1
  629. package/dist/src/cli/cli-options.d.ts +0 -10
  630. package/dist/src/cli/cli-options.js +0 -132
  631. package/dist/src/cli/cli-options.js.map +0 -1
  632. package/dist/src/cli/cli-options.test.d.ts +0 -1
  633. package/dist/src/cli/cli-options.test.js +0 -34
  634. package/dist/src/cli/cli-options.test.js.map +0 -1
  635. package/dist/src/cli/cli-params.d.ts +0 -32
  636. package/dist/src/cli/cli-params.js +0 -106
  637. package/dist/src/cli/cli-params.js.map +0 -1
  638. package/dist/src/cli/cli-params.test.d.ts +0 -1
  639. package/dist/src/cli/cli-params.test.js +0 -38
  640. package/dist/src/cli/cli-params.test.js.map +0 -1
  641. package/dist/src/cli/service-autodetect.d.ts +0 -2
  642. package/dist/src/cli/service-autodetect.js +0 -17
  643. package/dist/src/cli/service-autodetect.js.map +0 -1
  644. package/dist/src/cli/service-autodetect.test.d.ts +0 -1
  645. package/dist/src/cli/service-autodetect.test.js +0 -38
  646. package/dist/src/cli/service-autodetect.test.js.map +0 -1
  647. package/dist/src/cli/validate-cli-params.d.ts +0 -18
  648. package/dist/src/cli/validate-cli-params.js +0 -145
  649. package/dist/src/cli/validate-cli-params.js.map +0 -1
  650. package/dist/src/cli/validate-cli-params.test.d.ts +0 -1
  651. package/dist/src/cli/validate-cli-params.test.js +0 -106
  652. package/dist/src/cli/validate-cli-params.test.js.map +0 -1
  653. package/dist/src/files/cache-file.d.ts +0 -3
  654. package/dist/src/files/cache-file.js +0 -36
  655. package/dist/src/files/cache-file.js.map +0 -1
  656. package/dist/src/files/file-utils.d.ts +0 -2
  657. package/dist/src/files/file-utils.js +0 -7
  658. package/dist/src/files/file-utils.js.map +0 -1
  659. package/dist/src/files/file-utils.test.d.ts +0 -1
  660. package/dist/src/files/file-utils.test.js +0 -18
  661. package/dist/src/files/file-utils.test.js.map +0 -1
  662. package/dist/src/files/find-files.d.ts +0 -9
  663. package/dist/src/files/find-files.js +0 -81
  664. package/dist/src/files/find-files.js.map +0 -1
  665. package/dist/src/files/path-utils.d.ts +0 -1
  666. package/dist/src/files/path-utils.js +0 -12
  667. package/dist/src/files/path-utils.js.map +0 -1
  668. package/dist/src/files/read-files.d.ts +0 -21
  669. package/dist/src/files/read-files.js +0 -68
  670. package/dist/src/files/read-files.js.map +0 -1
  671. package/dist/src/files/read-files.test.d.ts +0 -1
  672. package/dist/src/files/read-files.test.js +0 -89
  673. package/dist/src/files/read-files.test.js.map +0 -1
  674. package/dist/src/files/temp-buffer.d.ts +0 -2
  675. package/dist/src/files/temp-buffer.js +0 -12
  676. package/dist/src/files/temp-buffer.js.map +0 -1
  677. package/dist/src/files/update-files.d.ts +0 -6
  678. package/dist/src/files/update-files.js +0 -19
  679. package/dist/src/files/update-files.js.map +0 -1
  680. package/dist/src/images/ensure-alpha.d.ts +0 -1
  681. package/dist/src/images/ensure-alpha.js +0 -5
  682. package/dist/src/images/ensure-alpha.js.map +0 -1
  683. package/dist/src/images/imgly-remove-background.d.ts +0 -2
  684. package/dist/src/images/imgly-remove-background.js +0 -21
  685. package/dist/src/images/imgly-remove-background.js.map +0 -1
  686. package/dist/src/images/resize-image.d.ts +0 -19
  687. package/dist/src/images/resize-image.js +0 -22
  688. package/dist/src/images/resize-image.js.map +0 -1
  689. package/dist/src/images/split-image.d.ts +0 -18
  690. package/dist/src/images/split-image.js +0 -25
  691. package/dist/src/images/split-image.js.map +0 -1
  692. package/dist/src/index.d.ts +0 -3
  693. package/dist/src/index.js +0 -3
  694. package/dist/src/index.js.map +0 -1
  695. package/dist/src/main/codegen-types.d.ts +0 -58
  696. package/dist/src/main/codegen-types.js +0 -2
  697. package/dist/src/main/codegen-types.js.map +0 -1
  698. package/dist/src/main/codegen-utils.d.ts +0 -3
  699. package/dist/src/main/codegen-utils.js +0 -18
  700. package/dist/src/main/codegen-utils.js.map +0 -1
  701. package/dist/src/main/codegen.d.ts +0 -4
  702. package/dist/src/main/codegen.js +0 -201
  703. package/dist/src/main/codegen.js.map +0 -1
  704. package/dist/src/main/codegen.test.d.ts +0 -3
  705. package/dist/src/main/codegen.test.js +0 -288
  706. package/dist/src/main/codegen.test.js.map +0 -1
  707. package/dist/src/main/common/content-bus-types.d.ts +0 -21
  708. package/dist/src/main/common/content-bus-types.js +0 -11
  709. package/dist/src/main/common/content-bus-types.js.map +0 -1
  710. package/dist/src/main/common/content-bus.d.ts +0 -10
  711. package/dist/src/main/common/content-bus.js +0 -39
  712. package/dist/src/main/common/content-bus.js.map +0 -1
  713. package/dist/src/main/common/cost-collector.d.ts +0 -11
  714. package/dist/src/main/common/cost-collector.js +0 -90
  715. package/dist/src/main/common/cost-collector.js.map +0 -1
  716. package/dist/src/main/common/user-actions.d.ts +0 -19
  717. package/dist/src/main/common/user-actions.js +0 -30
  718. package/dist/src/main/common/user-actions.js.map +0 -1
  719. package/dist/src/main/config-lib.d.ts +0 -36
  720. package/dist/src/main/config-lib.js +0 -51
  721. package/dist/src/main/config-lib.js.map +0 -1
  722. package/dist/src/main/config-lib.test.d.ts +0 -1
  723. package/dist/src/main/config-lib.test.js +0 -64
  724. package/dist/src/main/config-lib.test.js.map +0 -1
  725. package/dist/src/main/config.d.ts +0 -7
  726. package/dist/src/main/config.js +0 -51
  727. package/dist/src/main/config.js.map +0 -1
  728. package/dist/src/main/interactive/codegen-interactive.d.ts +0 -2
  729. package/dist/src/main/interactive/codegen-interactive.js +0 -61
  730. package/dist/src/main/interactive/codegen-interactive.js.map +0 -1
  731. package/dist/src/main/interactive/codegen-interactive.test.d.ts +0 -5
  732. package/dist/src/main/interactive/codegen-interactive.test.js +0 -79
  733. package/dist/src/main/interactive/codegen-interactive.test.js.map +0 -1
  734. package/dist/src/main/interactive/codegen-worker.d.ts +0 -3
  735. package/dist/src/main/interactive/codegen-worker.js +0 -54
  736. package/dist/src/main/interactive/codegen-worker.js.map +0 -1
  737. package/dist/src/main/interactive/common.d.ts +0 -5
  738. package/dist/src/main/interactive/common.js +0 -51
  739. package/dist/src/main/interactive/common.js.map +0 -1
  740. package/dist/src/main/interactive/configure.d.ts +0 -2
  741. package/dist/src/main/interactive/configure.js +0 -99
  742. package/dist/src/main/interactive/configure.js.map +0 -1
  743. package/dist/src/main/interactive/error-handling.d.ts +0 -1
  744. package/dist/src/main/interactive/error-handling.js +0 -43
  745. package/dist/src/main/interactive/error-handling.js.map +0 -1
  746. package/dist/src/main/interactive/help.d.ts +0 -1
  747. package/dist/src/main/interactive/help.js +0 -22
  748. package/dist/src/main/interactive/help.js.map +0 -1
  749. package/dist/src/main/interactive/process-comments.d.ts +0 -2
  750. package/dist/src/main/interactive/process-comments.js +0 -39
  751. package/dist/src/main/interactive/process-comments.js.map +0 -1
  752. package/dist/src/main/interactive/select-ai-service.d.ts +0 -2
  753. package/dist/src/main/interactive/select-ai-service.js +0 -27
  754. package/dist/src/main/interactive/select-ai-service.js.map +0 -1
  755. package/dist/src/main/interactive/task-file.d.ts +0 -2
  756. package/dist/src/main/interactive/task-file.js +0 -35
  757. package/dist/src/main/interactive/task-file.js.map +0 -1
  758. package/dist/src/main/interactive/text-prompt.d.ts +0 -2
  759. package/dist/src/main/interactive/text-prompt.js +0 -18
  760. package/dist/src/main/interactive/text-prompt.js.map +0 -1
  761. package/dist/src/main/interactive/user-action-handlers.d.ts +0 -1
  762. package/dist/src/main/interactive/user-action-handlers.js +0 -13
  763. package/dist/src/main/interactive/user-action-handlers.js.map +0 -1
  764. package/dist/src/main/interactive/user-interrupt.d.ts +0 -1
  765. package/dist/src/main/interactive/user-interrupt.js +0 -36
  766. package/dist/src/main/interactive/user-interrupt.js.map +0 -1
  767. package/dist/src/main/plugin-loader.d.ts +0 -6
  768. package/dist/src/main/plugin-loader.js +0 -40
  769. package/dist/src/main/plugin-loader.js.map +0 -1
  770. package/dist/src/main/ui/backend/api-utils.d.ts +0 -2
  771. package/dist/src/main/ui/backend/api-utils.js +0 -18
  772. package/dist/src/main/ui/backend/api-utils.js.map +0 -1
  773. package/dist/src/main/ui/backend/api.d.ts +0 -2
  774. package/dist/src/main/ui/backend/api.js +0 -210
  775. package/dist/src/main/ui/backend/api.js.map +0 -1
  776. package/dist/src/main/ui/backend/server.d.ts +0 -7
  777. package/dist/src/main/ui/backend/server.js +0 -83
  778. package/dist/src/main/ui/backend/server.js.map +0 -1
  779. package/dist/src/main/ui/backend/service.d.ts +0 -44
  780. package/dist/src/main/ui/backend/service.js +0 -171
  781. package/dist/src/main/ui/backend/service.js.map +0 -1
  782. package/dist/src/main/ui/codegen-ui.d.ts +0 -2
  783. package/dist/src/main/ui/codegen-ui.js +0 -13
  784. package/dist/src/main/ui/codegen-ui.js.map +0 -1
  785. package/dist/src/main/ui/common/api-types.d.ts +0 -20
  786. package/dist/src/main/ui/common/api-types.js +0 -2
  787. package/dist/src/main/ui/common/api-types.js.map +0 -1
  788. package/dist/src/main/ui/user-action-handlers.d.ts +0 -2
  789. package/dist/src/main/ui/user-action-handlers.js +0 -14
  790. package/dist/src/main/ui/user-action-handlers.js.map +0 -1
  791. package/dist/src/operations/create-directory/create-directory-def.d.ts +0 -9
  792. package/dist/src/operations/create-directory/create-directory-def.js +0 -22
  793. package/dist/src/operations/create-directory/create-directory-def.js.map +0 -1
  794. package/dist/src/operations/create-directory/create-directory-executor.d.ts +0 -6
  795. package/dist/src/operations/create-directory/create-directory-executor.js +0 -22
  796. package/dist/src/operations/create-directory/create-directory-executor.js.map +0 -1
  797. package/dist/src/operations/create-file/create-file-def.d.ts +0 -10
  798. package/dist/src/operations/create-file/create-file-def.js +0 -26
  799. package/dist/src/operations/create-file/create-file-def.js.map +0 -1
  800. package/dist/src/operations/create-file/create-file-executor.d.ts +0 -6
  801. package/dist/src/operations/create-file/create-file-executor.js +0 -27
  802. package/dist/src/operations/create-file/create-file-executor.js.map +0 -1
  803. package/dist/src/operations/delete-file/delete-file-def.d.ts +0 -9
  804. package/dist/src/operations/delete-file/delete-file-def.js +0 -22
  805. package/dist/src/operations/delete-file/delete-file-def.js.map +0 -1
  806. package/dist/src/operations/delete-file/delete-file-executor.d.ts +0 -6
  807. package/dist/src/operations/delete-file/delete-file-executor.js +0 -23
  808. package/dist/src/operations/delete-file/delete-file-executor.js.map +0 -1
  809. package/dist/src/operations/download-file/download-file-def.d.ts +0 -10
  810. package/dist/src/operations/download-file/download-file-def.js +0 -26
  811. package/dist/src/operations/download-file/download-file-def.js.map +0 -1
  812. package/dist/src/operations/download-file/download-file-executor.d.ts +0 -6
  813. package/dist/src/operations/download-file/download-file-executor.js +0 -44
  814. package/dist/src/operations/download-file/download-file-executor.js.map +0 -1
  815. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.d.ts +0 -10
  816. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js +0 -26
  817. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js.map +0 -1
  818. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.d.ts +0 -6
  819. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js +0 -40
  820. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js.map +0 -1
  821. package/dist/src/operations/move-file/move-file-def.d.ts +0 -10
  822. package/dist/src/operations/move-file/move-file-def.js +0 -26
  823. package/dist/src/operations/move-file/move-file-def.js.map +0 -1
  824. package/dist/src/operations/move-file/move-file-executor.d.ts +0 -6
  825. package/dist/src/operations/move-file/move-file-executor.js +0 -29
  826. package/dist/src/operations/move-file/move-file-executor.js.map +0 -1
  827. package/dist/src/operations/operations-index.d.ts +0 -3
  828. package/dist/src/operations/operations-index.js +0 -33
  829. package/dist/src/operations/operations-index.js.map +0 -1
  830. package/dist/src/operations/patch-file/patch-file-def.d.ts +0 -10
  831. package/dist/src/operations/patch-file/patch-file-def.js +0 -39
  832. package/dist/src/operations/patch-file/patch-file-def.js.map +0 -1
  833. package/dist/src/operations/patch-file/patch-file-executor.d.ts +0 -5
  834. package/dist/src/operations/patch-file/patch-file-executor.js +0 -26
  835. package/dist/src/operations/patch-file/patch-file-executor.js.map +0 -1
  836. package/dist/src/operations/resize-image/resize-image-def.d.ts +0 -13
  837. package/dist/src/operations/resize-image/resize-image-def.js +0 -37
  838. package/dist/src/operations/resize-image/resize-image-def.js.map +0 -1
  839. package/dist/src/operations/resize-image/resize-image-executor.d.ts +0 -5
  840. package/dist/src/operations/resize-image/resize-image-executor.js +0 -30
  841. package/dist/src/operations/resize-image/resize-image-executor.js.map +0 -1
  842. package/dist/src/operations/split-image/split-image-def.d.ts +0 -18
  843. package/dist/src/operations/split-image/split-image-def.js +0 -46
  844. package/dist/src/operations/split-image/split-image-def.js.map +0 -1
  845. package/dist/src/operations/split-image/split-image-executor.d.ts +0 -6
  846. package/dist/src/operations/split-image/split-image-executor.js +0 -51
  847. package/dist/src/operations/split-image/split-image-executor.js.map +0 -1
  848. package/dist/src/operations/update-file/update-file-def.d.ts +0 -10
  849. package/dist/src/operations/update-file/update-file-def.js +0 -26
  850. package/dist/src/operations/update-file/update-file-def.js.map +0 -1
  851. package/dist/src/operations/update-file/update-file-executor.d.ts +0 -5
  852. package/dist/src/operations/update-file/update-file-executor.js +0 -22
  853. package/dist/src/operations/update-file/update-file-executor.js.map +0 -1
  854. package/dist/src/prompt/ai-service-fallback.d.ts +0 -3
  855. package/dist/src/prompt/ai-service-fallback.js +0 -84
  856. package/dist/src/prompt/ai-service-fallback.js.map +0 -1
  857. package/dist/src/prompt/function-calling-validate.d.ts +0 -3
  858. package/dist/src/prompt/function-calling-validate.js +0 -99
  859. package/dist/src/prompt/function-calling-validate.js.map +0 -1
  860. package/dist/src/prompt/function-calling.d.ts +0 -5
  861. package/dist/src/prompt/function-calling.js +0 -43
  862. package/dist/src/prompt/function-calling.js.map +0 -1
  863. package/dist/src/prompt/function-defs/ask-question-reflect.d.ts +0 -2
  864. package/dist/src/prompt/function-defs/ask-question-reflect.js +0 -21
  865. package/dist/src/prompt/function-defs/ask-question-reflect.js.map +0 -1
  866. package/dist/src/prompt/function-defs/ask-question.d.ts +0 -8
  867. package/dist/src/prompt/function-defs/ask-question.js +0 -100
  868. package/dist/src/prompt/function-defs/ask-question.js.map +0 -1
  869. package/dist/src/prompt/function-defs/codegen-summary.d.ts +0 -5
  870. package/dist/src/prompt/function-defs/codegen-summary.js +0 -82
  871. package/dist/src/prompt/function-defs/codegen-summary.js.map +0 -1
  872. package/dist/src/prompt/function-defs/explanation.d.ts +0 -5
  873. package/dist/src/prompt/function-defs/explanation.js +0 -18
  874. package/dist/src/prompt/function-defs/explanation.js.map +0 -1
  875. package/dist/src/prompt/function-defs/generate-image.d.ts +0 -5
  876. package/dist/src/prompt/function-defs/generate-image.js +0 -42
  877. package/dist/src/prompt/function-defs/generate-image.js.map +0 -1
  878. package/dist/src/prompt/function-defs/get-image-assets.d.ts +0 -5
  879. package/dist/src/prompt/function-defs/get-image-assets.js +0 -21
  880. package/dist/src/prompt/function-defs/get-image-assets.js.map +0 -1
  881. package/dist/src/prompt/function-defs/get-source-code.d.ts +0 -5
  882. package/dist/src/prompt/function-defs/get-source-code.js +0 -22
  883. package/dist/src/prompt/function-defs/get-source-code.js.map +0 -1
  884. package/dist/src/prompt/function-defs/optimize-context.d.ts +0 -5
  885. package/dist/src/prompt/function-defs/optimize-context.js +0 -47
  886. package/dist/src/prompt/function-defs/optimize-context.js.map +0 -1
  887. package/dist/src/prompt/function-defs/read-history.d.ts +0 -2
  888. package/dist/src/prompt/function-defs/read-history.js +0 -14
  889. package/dist/src/prompt/function-defs/read-history.js.map +0 -1
  890. package/dist/src/prompt/function-defs/set-summaries.d.ts +0 -5
  891. package/dist/src/prompt/function-defs/set-summaries.js +0 -32
  892. package/dist/src/prompt/function-defs/set-summaries.js.map +0 -1
  893. package/dist/src/prompt/function-defs/update-history.d.ts +0 -5
  894. package/dist/src/prompt/function-defs/update-history.js +0 -22
  895. package/dist/src/prompt/function-defs/update-history.js.map +0 -1
  896. package/dist/src/prompt/limits.d.ts +0 -3
  897. package/dist/src/prompt/limits.js +0 -21
  898. package/dist/src/prompt/limits.js.map +0 -1
  899. package/dist/src/prompt/limits.test.d.ts +0 -1
  900. package/dist/src/prompt/limits.test.js +0 -35
  901. package/dist/src/prompt/limits.test.js.map +0 -1
  902. package/dist/src/prompt/prompt-codegen.d.ts +0 -9
  903. package/dist/src/prompt/prompt-codegen.js +0 -117
  904. package/dist/src/prompt/prompt-codegen.js.map +0 -1
  905. package/dist/src/prompt/prompt-codegen.test.d.ts +0 -1
  906. package/dist/src/prompt/prompt-codegen.test.js +0 -98
  907. package/dist/src/prompt/prompt-codegen.test.js.map +0 -1
  908. package/dist/src/prompt/prompt-consts.d.ts +0 -1
  909. package/dist/src/prompt/prompt-consts.js +0 -2
  910. package/dist/src/prompt/prompt-consts.js.map +0 -1
  911. package/dist/src/prompt/prompt-service-ask-question.test.d.ts +0 -4
  912. package/dist/src/prompt/prompt-service-ask-question.test.js +0 -215
  913. package/dist/src/prompt/prompt-service-ask-question.test.js.map +0 -1
  914. package/dist/src/prompt/prompt-service.d.ts +0 -5
  915. package/dist/src/prompt/prompt-service.js +0 -214
  916. package/dist/src/prompt/prompt-service.js.map +0 -1
  917. package/dist/src/prompt/prompt-service.test.d.ts +0 -2
  918. package/dist/src/prompt/prompt-service.test.js +0 -553
  919. package/dist/src/prompt/prompt-service.test.js.map +0 -1
  920. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
  921. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +0 -16
  922. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
  923. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +0 -2
  924. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +0 -37
  925. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +0 -1
  926. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +0 -2
  927. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js +0 -36
  928. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js.map +0 -1
  929. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
  930. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js +0 -18
  931. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
  932. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
  933. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
  934. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
  935. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +0 -2
  936. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +0 -43
  937. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +0 -1
  938. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +0 -2
  939. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js +0 -49
  940. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js.map +0 -1
  941. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +0 -2
  942. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js +0 -46
  943. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js.map +0 -1
  944. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
  945. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
  946. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
  947. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  948. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
  949. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
  950. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
  951. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -91
  952. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
  953. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.d.ts +0 -55
  954. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js +0 -2
  955. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js.map +0 -1
  956. package/dist/src/prompt/steps/step-ask-question/step-ask-question.d.ts +0 -6
  957. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js +0 -88
  958. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js.map +0 -1
  959. package/dist/src/prompt/steps/step-context-optimization.d.ts +0 -4
  960. package/dist/src/prompt/steps/step-context-optimization.js +0 -200
  961. package/dist/src/prompt/steps/step-context-optimization.js.map +0 -1
  962. package/dist/src/prompt/steps/step-generate-image.d.ts +0 -2
  963. package/dist/src/prompt/steps/step-generate-image.js +0 -29
  964. package/dist/src/prompt/steps/step-generate-image.js.map +0 -1
  965. package/dist/src/prompt/steps/step-generate-summary.d.ts +0 -3
  966. package/dist/src/prompt/steps/step-generate-summary.js +0 -41
  967. package/dist/src/prompt/steps/step-generate-summary.js.map +0 -1
  968. package/dist/src/prompt/steps/step-history-update.d.ts +0 -5
  969. package/dist/src/prompt/steps/step-history-update.js +0 -54
  970. package/dist/src/prompt/steps/step-history-update.js.map +0 -1
  971. package/dist/src/prompt/steps/step-summarization.d.ts +0 -8
  972. package/dist/src/prompt/steps/step-summarization.js +0 -75
  973. package/dist/src/prompt/steps/step-summarization.js.map +0 -1
  974. package/dist/src/prompt/steps/step-validate-recover.d.ts +0 -2
  975. package/dist/src/prompt/steps/step-validate-recover.js +0 -51
  976. package/dist/src/prompt/steps/step-validate-recover.js.map +0 -1
  977. package/dist/src/prompt/steps/step-verify-patch.d.ts +0 -6
  978. package/dist/src/prompt/steps/step-verify-patch.js +0 -34
  979. package/dist/src/prompt/steps/step-verify-patch.js.map +0 -1
  980. package/dist/src/prompt/steps/steps-types.d.ts +0 -16
  981. package/dist/src/prompt/steps/steps-types.js +0 -6
  982. package/dist/src/prompt/steps/steps-types.js.map +0 -1
  983. package/dist/src/prompt/steps/steps-utils.d.ts +0 -7
  984. package/dist/src/prompt/steps/steps-utils.js +0 -11
  985. package/dist/src/prompt/steps/steps-utils.js.map +0 -1
  986. package/dist/src/prompt/systemprompt.d.ts +0 -3
  987. package/dist/src/prompt/systemprompt.js +0 -209
  988. package/dist/src/prompt/systemprompt.js.map +0 -1
  989. package/dist/src/prompt/systemprompt.test.d.ts +0 -3
  990. package/dist/src/prompt/systemprompt.test.js +0 -43
  991. package/dist/src/prompt/systemprompt.test.js.map +0 -1
  992. package/dist/src/prompt/token-estimator.d.ts +0 -8
  993. package/dist/src/prompt/token-estimator.js +0 -31
  994. package/dist/src/prompt/token-estimator.js.map +0 -1
  995. package/dist/src/vite-genaicode/vite-genaicode-frontend.d.ts +0 -1
  996. package/dist/src/vite-genaicode/vite-genaicode-frontend.js +0 -142
  997. package/dist/src/vite-genaicode/vite-genaicode-frontend.js.map +0 -1
  998. package/dist/src/vite-genaicode/vite-genaicode-plugin.d.ts +0 -7
  999. package/dist/src/vite-genaicode/vite-genaicode-plugin.js +0 -40
  1000. package/dist/src/vite-genaicode/vite-genaicode-plugin.js.map +0 -1
  1001. package/dist/vite-genaicode/vite-genaicode-frontend.d.ts.map +0 -1
  1002. package/dist/vite-genaicode/vite-genaicode-plugin.d.ts.map +0 -1
  1003. /package/dist/{ai-service/common.test.d.ts → main/ui/backend/endpoints/context-endpoint.d.ts} +0 -0
@@ -1,125 +0,0 @@
1
- import { getSystemPrompt } from '../prompt/systemprompt';
2
- export const DEBUG_PROMPT2 = [
3
- {
4
- type: 'systemPrompt',
5
- systemPrompt: getSystemPrompt({ verbose: false, askQuestion: true, interactive: false, ui: true }),
6
- },
7
- {
8
- type: 'user',
9
- text: 'Hello, GenAIcode!',
10
- },
11
- {
12
- type: 'assistant',
13
- text: 'Hello there! I guess you have a task for me today. Before we start, could you please provide me with the current source code of your application, and the image assets?',
14
- functionCalls: [
15
- {
16
- name: 'getSourceCode',
17
- },
18
- {
19
- name: 'getImageAssets',
20
- },
21
- ],
22
- },
23
- {
24
- type: 'user',
25
- functionResponses: [
26
- {
27
- name: 'getSourceCode',
28
- content: JSON.stringify({
29
- '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers': {
30
- 'cancel-code-generation.ts': { summary: 'Handles the cancellation of code generation.' },
31
- 'confirm-code-generation.ts': { summary: 'Handles confirmation of code generation' },
32
- 'context-optimization.ts': { summary: 'Handles context optimization' },
33
- 'default-action.ts': { summary: 'Default action handler' },
34
- 'handle-request-answer-with-image.ts': {
35
- summary: 'Handles request to generate image and display it to user',
36
- },
37
- 'handle-request-answer.ts': { summary: 'Handles user answer requests' },
38
- 'handler-utils.ts': { summary: 'Utility functions for step-ask-question handlers' },
39
- 'remove-files-from-context.ts': { summary: 'Handles removing files from context' },
40
- 'request-files-content.ts': { summary: 'Handles requesting content of missing files' },
41
- 'request-permissions.ts': { summary: 'Handles requesting permissions from user' },
42
- 'start-code-generation.ts': { summary: 'Handles the start of code generation.' },
43
- },
44
- }),
45
- },
46
- {
47
- name: 'getImageAssets',
48
- content: '{"/Users/gtanczyk/src/codegen/media/logo-dark.png":{"mimeType":"image/png","width":1200,"height":686},"/Users/gtanczyk/src/codegen/media/logo.png":{"mimeType":"image/png","width":1200,"height":686},"/Users/gtanczyk/src/codegen/src/vite-genaicode/media/demo-for-readme.gif":{"mimeType":"image/gif","width":769,"height":465}}',
49
- },
50
- ],
51
- cache: true,
52
- text: 'Sure, here is the application source code and image assets.',
53
- },
54
- {
55
- type: 'assistant',
56
- text: "Thank you, I'm ready to assist you with your request.",
57
- },
58
- {
59
- type: 'user',
60
- text: 'Hello',
61
- },
62
- {
63
- type: 'assistant',
64
- text: 'Hello, How can I assist you today?',
65
- },
66
- {
67
- type: 'user',
68
- text: 'we will be working on files from src/prompt/steps/step-ask-question/handlers, I want you to analyze them and provide me with a summary of the content of each file.',
69
- },
70
- // {
71
- // type: 'assistant',
72
- // text: 'Please provide the content of the following files from the src/prompt/steps/step-ask-question/handlers directory: \n- cancel-code-generation.ts\n- confirm-code-generation.ts \n- context-optimization.ts\n- default-action.ts\n- handle-request-answer-with-image.ts\n- handle-request-answer.ts\n- handler-utils.ts\n- remove-files-from-context.ts\n- request-files-content.ts\n- request-permissions.ts\n- start-code-generation.ts',
73
- // functionCalls: [
74
- // {
75
- // name: 'getSourceCode',
76
- // id: 'toolu_019TwZHC29M4DDNGqt72yKek_source',
77
- // args: {
78
- // filePaths: [
79
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.ts',
80
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.ts',
81
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/context-optimization.ts',
82
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/default-action.ts',
83
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.ts',
84
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handle-request-answer.ts',
85
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handler-utils.ts',
86
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.ts',
87
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/request-files-content.ts',
88
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/request-permissions.ts',
89
- // '/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/start-code-generation.ts',
90
- // ],
91
- // },
92
- // },
93
- // ],
94
- // },
95
- // {
96
- // type: 'user',
97
- // text: 'All requested file contents have been provided.',
98
- // functionResponses: [
99
- // {
100
- // name: 'getSourceCode',
101
- // call_id: 'toolu_019TwZHC29M4DDNGqt72yKek_source',
102
- // content:
103
- // "{\"/Users/gtanczyk/src/codegen/src/main/codegen-types.ts\":{\"content\":\"import { FunctionDef, GenerateContentFunction } from '../ai-service/common';\\nimport { ActionHandler } from '../prompt/steps/step-ask-question/step-ask-question-types';\\n\\n/** Example: {@link ../../examples/genaicode_plugins/grok_ai_service.ts} */\\nexport type PluginAiServiceType = `plugin:${string}`;\\n\\n/** Example: {@link ../../examples/genaicode_plugins/nonsense_action_handlers.ts} */\\nexport type PluginActionType = `plugin:${string}`;\\n\\nexport type AiServiceType =\\n | 'vertex-ai'\\n | 'ai-studio'\\n | 'vertex-ai-claude'\\n | 'chat-gpt'\\n | 'anthropic'\\n | PluginAiServiceType;\\n\\nexport type ImagenType = 'vertex-ai' | 'dall-e';\\n\\nexport interface UploadedImage {\\n base64url: string;\\n mediaType: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';\\n originalName: string;\\n}\\n\\nexport interface CodegenOptions {\\n explicitPrompt?: string;\\n taskFile?: string;\\n considerAllFiles?: boolean;\\n allowFileCreate?: boolean;\\n allowFileDelete?: boolean;\\n allowDirectoryCreate?: boolean;\\n allowFileMove?: boolean;\\n vision?: boolean;\\n imagen?: ImagenType;\\n aiService: AiServiceType;\\n\\n disableContextOptimization?: boolean;\\n temperature?: number;\\n cheap?: boolean;\\n dryRun?: boolean;\\n verbose?: boolean;\\n requireExplanations?: boolean;\\n geminiBlockNone?: boolean;\\n disableInitialLint?: boolean;\\n contentMask?: string;\\n ignorePatterns?: string[];\\n askQuestion?: boolean;\\n interactive?: boolean;\\n ui?: boolean;\\n uiPort?: number;\\n uiFrameAncestors?: string[];\\n disableCache?: boolean;\\n dependencyTree?: boolean;\\n historyEnabled?: boolean;\\n\\n disableAiServiceFallback?: boolean;\\n conversationSummaryEnabled?: boolean;\\n images?: UploadedImage[];\\n isDev?: boolean;\\n}\\n\\ninterface ExecutorArgs {\\n [key: string]: unknown;\\n}\\n\\nexport type OperationExecutor = (args: ExecutorArgs, options: CodegenOptions) => Promise<void>;\\n\\nexport type Operation = {\\n executor: OperationExecutor;\\n def: FunctionDef;\\n};\\n\\nexport interface Plugin {\\n name: string;\\n aiServices?: Record<string, GenerateContentFunction>;\\n operations?: Record<string, Operation>;\\n actionHandlers?: Record<\\n string,\\n {\\n /** The action handler implementation */\\n handler: ActionHandler;\\n /**\\n * Description of what this action handler does.\\n * This description will be included in the askQuestion function definition\\n * to help the AI understand when to use this action.\\n */\\n description: string;\\n }\\n >;\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/main/codegen.ts\":{\"content\":\"import { exec } from 'child_process';\\nimport util from 'util';\\n\\nimport * as cliParams from '../cli/cli-params.js';\\nimport { validateCliParams } from '../cli/validate-cli-params.js';\\nimport { generateContent as generateContentVertexAi } from '../ai-service/vertex-ai.js';\\nimport { generateContent as generateContentGPT } from '../ai-service/chat-gpt.js';\\nimport { generateContent as generateContentAnthropic } from '../ai-service/anthropic.js';\\nimport { generateContent as generateContentVertexAiClaude } from '../ai-service/vertex-ai-claude.js';\\nimport { generateContent as generateContentAiStudio } from '../ai-service/ai-studio.js';\\nimport { generateImage as generateImageDallE } from '../ai-service/dall-e.js';\\nimport { generateImage as generateImageVertexAi } from '../ai-service/vertex-ai-imagen.js';\\n\\nimport { promptService } from '../prompt/prompt-service.js';\\nimport { updateFiles } from '../files/update-files.js';\\nimport { rcConfig } from '../main/config.js';\\nimport { AiServiceType, CodegenOptions, ImagenType } from './codegen-types.js';\\nimport { getLintFixPrompt } from '../prompt/prompt-codegen.js';\\nimport { printHelpMessage } from '../cli/cli-options.js';\\nimport { FunctionCall, GenerateContentFunction, GenerateImageFunction } from '../ai-service/common.js';\\nimport { getCodeGenPrompt } from '../prompt/prompt-codegen.js';\\n\\nimport { runInteractiveMode } from './interactive/codegen-interactive.js';\\nimport { runCodegenUI } from './ui/codegen-ui.js';\\nimport {\\n putSystemMessage,\\n putUserMessage,\\n setCurrentIterationId,\\n unsetCurrentIterationId,\\n} from './common/content-bus.js';\\nimport { refreshFiles } from '../files/find-files.js';\\nimport { getRegisteredAiServices } from './plugin-loader.js';\\nimport { stringToAiServiceType } from './codegen-utils.js';\\n\\n/** Executes codegen */\\nexport async function runCodegen(isDev = false): Promise<void> {\\n // Print to console the received parameters\\n console.log(`Received parameters: ${process.argv.slice(2).join(' ')}`);\\n\\n validateCliParams();\\n\\n // Handle --help option\\n if (cliParams.helpRequested) {\\n printHelpMessage();\\n return;\\n }\\n\\n const options: CodegenOptions = {\\n explicitPrompt: cliParams.explicitPrompt,\\n taskFile: cliParams.taskFile,\\n considerAllFiles: cliParams.considerAllFiles,\\n dependencyTree: cliParams.dependencyTree,\\n\\n allowFileCreate: cliParams.allowFileCreate,\\n allowFileDelete: cliParams.allowFileDelete,\\n allowDirectoryCreate: cliParams.allowDirectoryCreate,\\n allowFileMove: cliParams.allowFileMove,\\n\\n aiService: stringToAiServiceType(cliParams.aiService),\\n vision: cliParams.vision,\\n imagen: cliParams.imagen,\\n\\n disableContextOptimization: cliParams.disableContextOptimization,\\n temperature: cliParams.temperature,\\n cheap: cliParams.cheap,\\n dryRun: cliParams.dryRun,\\n verbose: cliParams.verbosePrompt,\\n requireExplanations: !cliParams.disableExplanations,\\n geminiBlockNone: cliParams.geminiBlockNone,\\n disableInitialLint: cliParams.disableInitialLint,\\n contentMask: cliParams.contentMask,\\n ignorePatterns: cliParams.ignorePatterns,\\n askQuestion: cliParams.askQuestion,\\n disableCache: cliParams.disableCache,\\n interactive: cliParams.interactive,\\n ui: cliParams.ui,\\n uiPort: cliParams.uiPort,\\n disableAiServiceFallback: cliParams.disableAiServiceFallback,\\n historyEnabled: !cliParams.disableHistory,\\n conversationSummaryEnabled: !cliParams.disableConversationSummary,\\n\\n isDev,\\n };\\n\\n if (cliParams.ui) {\\n await runCodegenUI(options);\\n } else if (cliParams.interactive) {\\n // Handle interactive mode\\n await runInteractiveMode(options);\\n } else {\\n console.log('Executing codegen in non-interactive mode');\\n await runCodegenIteration(options);\\n }\\n}\\n\\nexport async function runCodegenIteration(\\n options: CodegenOptions,\\n abortSignal?: AbortSignal,\\n waitIfPaused: () => Promise<void> = () => Promise.resolve(),\\n) {\\n refreshFiles();\\n\\n setCurrentIterationId();\\n\\n putUserMessage(\\n options.explicitPrompt ?? options.taskFile ?? 'Run codegen iteration without explicit prompt.',\\n undefined,\\n undefined,\\n options.images,\\n );\\n\\n if (rcConfig.lintCommand && !options.disableInitialLint) {\\n try {\\n putSystemMessage(`Executing lint command: ${rcConfig.lintCommand}`);\\n await execPromise(rcConfig.lintCommand, { cwd: rcConfig.rootDir });\\n putSystemMessage('Lint command executed successfully');\\n } catch (error) {\\n const { stderr, stdout } = error as { stdout: string; stderr: string };\\n putSystemMessage(\\n 'Lint command failed. Aborting codegen, please fix lint issues before running codegen, or use --disable-initial-lint',\\n );\\n console.log('Lint errors:', stdout, stderr);\\n unsetCurrentIterationId();\\n return;\\n }\\n } else if (rcConfig.lintCommand && options.disableInitialLint) {\\n console.log('Initial lint was skipped.');\\n }\\n\\n if (abortSignal?.aborted) {\\n unsetCurrentIterationId();\\n throw new Error('Codegen iteration aborted');\\n }\\n\\n await waitIfPaused();\\n\\n putSystemMessage('Generating response');\\n try {\\n const functionCalls = await promptService(\\n getGenerateContentFunctions(),\\n GENERATE_IMAGE_FNS,\\n getCodeGenPrompt(options),\\n waitIfPaused,\\n );\\n console.log('Received function calls:', functionCalls);\\n\\n await waitIfPaused();\\n\\n if (functionCalls.length === 0) {\\n putSystemMessage('No updates to apply');\\n } else if (options.dryRun) {\\n putSystemMessage('Dry run mode, not updating files');\\n } else {\\n putSystemMessage('Update files');\\n await updateFiles(\\n functionCalls.filter((call) => call.name !== 'explanation' && call.name !== 'getSourceCode'),\\n options,\\n );\\n putSystemMessage('Initial updates applied');\\n\\n if (abortSignal?.aborted) {\\n throw new Error('Codegen iteration aborted after initial updates');\\n }\\n\\n await waitIfPaused();\\n\\n // Check if lintCommand is specified in .genaicoderc\\n if (rcConfig.lintCommand && functionCalls.length > 0) {\\n try {\\n putSystemMessage(`Executing lint command: ${rcConfig.lintCommand}`);\\n await execPromise(rcConfig.lintCommand, { cwd: rcConfig.rootDir });\\n putSystemMessage('Lint command executed successfully');\\n } catch (error) {\\n putSystemMessage('Lint command failed. Attempting to fix issues...');\\n\\n // Prepare the lint error output for the second pass\\n const firstLintError = error as { stdout: string; stderr: string };\\n const lintErrorPrompt = getLintFixPrompt(\\n rcConfig.lintCommand,\\n options,\\n firstLintError.stdout,\\n firstLintError.stderr,\\n );\\n\\n putSystemMessage('Generating response for lint fixes');\\n const lintFixFunctionCalls = (await promptService(\\n getGenerateContentFunctions(),\\n GENERATE_IMAGE_FNS,\\n {\\n prompt: lintErrorPrompt,\\n options: { ...options, considerAllFiles: true },\\n },\\n waitIfPaused,\\n )) as FunctionCall[];\\n\\n console.log('Received function calls for lint fixes:', lintFixFunctionCalls);\\n\\n await waitIfPaused();\\n\\n putSystemMessage('Applying lint fixes');\\n updateFiles(\\n lintFixFunctionCalls.filter((call) => call.name !== 'explanation' && call.name !== 'getSourceCode'),\\n options,\\n );\\n\\n if (abortSignal?.aborted) {\\n throw new Error('Codegen iteration aborted after lint fixes');\\n }\\n\\n // Run lint command again to verify fixes\\n try {\\n putSystemMessage(`Re-running lint command: ${rcConfig.lintCommand}`);\\n await execPromise(rcConfig.lintCommand);\\n putSystemMessage('Lint command executed successfully after fixes');\\n } catch (secondLintError) {\\n const error = secondLintError as { stdout: string; stderr: string };\\n putSystemMessage('Lint command still failing after fixes. Manual intervention may be required.');\\n console.log('Lint errors:', error.stdout, error.stderr);\\n }\\n }\\n }\\n\\n console.log('Done!');\\n }\\n } catch (error) {\\n if (error instanceof Error) {\\n if (error.name === 'AbortError' || error.message.includes('interrupted')) {\\n putSystemMessage('Codegen iteration was interrupted');\\n } else if (error.message.includes('Rate limit exceeded')) {\\n putSystemMessage(\\n 'Rate limit exceeded. Consider switching to a different AI service or waiting before retrying.',\\n );\\n } else {\\n putSystemMessage(`An error occurred during codegen: ${error.message}`);\\n }\\n } else {\\n putSystemMessage('An unknown error occurred during codegen');\\n }\\n console.error('Error details:', error);\\n } finally {\\n unsetCurrentIterationId();\\n }\\n}\\n\\n// helper functions and consts\\n\\nconst execPromise = util.promisify(exec);\\n\\nfunction getGenerateContentFunctions(): Record<AiServiceType, GenerateContentFunction> {\\n return {\\n 'vertex-ai-claude': generateContentVertexAiClaude,\\n 'vertex-ai': generateContentVertexAi,\\n 'ai-studio': generateContentAiStudio,\\n anthropic: generateContentAnthropic,\\n 'chat-gpt': generateContentGPT,\\n ...Object.fromEntries(getRegisteredAiServices().entries()),\\n };\\n}\\n\\nconst GENERATE_IMAGE_FNS: Record<ImagenType, GenerateImageFunction> = {\\n 'dall-e': generateImageDallE,\\n 'vertex-ai': generateImageVertexAi,\\n} as const;\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/prompt-service.ts\":{\"content\":\"import assert from 'node:assert';\\nimport fs from 'fs';\\nimport mime from 'mime-types';\\n\\nimport { getSystemPrompt } from './systemprompt.js';\\nimport { getFunctionDefs } from './function-calling.js';\\nimport { getSourceCode, getImageAssets } from '../files/read-files.js';\\nimport {\\n PromptItem,\\n FunctionDef,\\n FunctionCall,\\n GenerateContentFunction,\\n GenerateImageFunction,\\n} from '../ai-service/common.js';\\nimport { importantContext } from '../main/config.js';\\nimport { AiServiceType, CodegenOptions, ImagenType } from '../main/codegen-types.js';\\nimport { executeStepAskQuestion } from './steps/step-ask-question/step-ask-question.js';\\nimport { validateAndRecoverSingleResult } from './steps/step-validate-recover.js';\\nimport { executeStepVerifyPatch } from './steps/step-verify-patch.js';\\nimport { executeStepGenerateImage } from './steps/step-generate-image.js';\\nimport { executeStepContextOptimization } from './steps/step-context-optimization.js';\\nimport { StepResult } from './steps/steps-types.js';\\nimport { CodegenPrompt } from './prompt-codegen.js';\\nimport { putSystemMessage } from '../main/common/content-bus.js';\\nimport { handleAiServiceFallback } from './ai-service-fallback.js';\\nimport { summarizeSourceCode } from './steps/step-summarization.js';\\nimport { executeStepHistoryUpdate, getCurrentHistory } from './steps/step-history-update.js';\\nimport { executeStepGenerateSummary } from './steps/step-generate-summary.js';\\nimport { getSourceCodeTree } from '../files/source-code-tree.js';\\n\\n/** A function that communicates with model using */\\nexport async function promptService(\\n generateContentFns: Record<AiServiceType, GenerateContentFunction>,\\n generateImageFns: Record<ImagenType, GenerateImageFunction>,\\n codegenPrompt: CodegenPrompt,\\n waitIfPaused: () => Promise<void> = () => Promise.resolve(),\\n): Promise<FunctionCall[]> {\\n const generateContentFn: GenerateContentFunction = async (...args) => {\\n return await handleAiServiceFallback(\\n generateContentFns,\\n codegenPrompt.options.aiService,\\n codegenPrompt.options,\\n ...args,\\n );\\n };\\n\\n const generateImageFn: GenerateImageFunction = (...args) => {\\n assert(codegenPrompt.options.imagen, 'imagen value must be provided');\\n return generateImageFns[codegenPrompt.options.imagen](...args);\\n };\\n\\n const { result, prompt } = await executePromptService(\\n generateContentFn,\\n generateImageFn,\\n codegenPrompt,\\n waitIfPaused,\\n );\\n\\n if (codegenPrompt.options.historyEnabled) {\\n await executeStepHistoryUpdate(generateContentFn, prompt, codegenPrompt.options);\\n }\\n\\n return result;\\n}\\n\\nasync function executePromptService(\\n generateContentFn: GenerateContentFunction,\\n generateImageFn: GenerateImageFunction,\\n codegenPrompt: CodegenPrompt,\\n waitIfPaused: () => Promise<void> = () => Promise.resolve(),\\n): Promise<{ result: FunctionCall[]; prompt: PromptItem[] }> {\\n const messages = prepareMessages(codegenPrompt);\\n\\n // First stage: summarize the source code\\n if (!codegenPrompt.options.disableContextOptimization) {\\n await summarizeSourceCode(\\n generateContentFn,\\n getSourceCode({ forceAll: true }, codegenPrompt.options),\\n codegenPrompt.options,\\n );\\n }\\n\\n // Second stage: generate code generation summary, which should not take a lot of output tokens\\n const getSourceCodeRequest: FunctionCall = { name: 'getSourceCode' };\\n\\n const prompt: PromptItem[] = [\\n { type: 'systemPrompt', systemPrompt: getSystemPrompt(codegenPrompt.options) },\\n { type: 'user', text: messages.suggestSourceCode },\\n {\\n type: 'assistant',\\n text: messages.requestSourceCode,\\n functionCalls: [getSourceCodeRequest, ...(codegenPrompt.options.historyEnabled ? [{ name: 'readHistory' }] : [])],\\n },\\n ];\\n\\n const getSourceCodeResponse: PromptItem = {\\n type: 'user',\\n functionResponses: [\\n { name: 'getSourceCode', content: messages.sourceCode },\\n ...(codegenPrompt.options.historyEnabled ? [{ name: 'readHistory', content: getCurrentHistory() }] : []),\\n ],\\n cache: true,\\n };\\n prompt.push(getSourceCodeResponse);\\n\\n if (codegenPrompt.options.vision) {\\n prompt.slice(-1)[0].text = messages.suggestImageAssets;\\n prompt.push(\\n { type: 'assistant', text: messages.requestImageAssets, functionCalls: [{ name: 'getImageAssets' }] },\\n { type: 'user', functionResponses: [{ name: 'getImageAssets', content: messages.imageAssets }] },\\n );\\n }\\n\\n prompt.slice(-1)[0].text = messages.prompt;\\n\\n // Add uploaded images to the prompt if available\\n if (codegenPrompt.options.images && codegenPrompt.options.images.length > 0 && codegenPrompt.options.vision) {\\n prompt.slice(-1)[0].images = codegenPrompt.options.images.map((img) => ({\\n base64url: img.base64url,\\n mediaType: img.mediaType,\\n }));\\n }\\n\\n // Initial summary based on first user input\\n await executeStepGenerateSummary(generateContentFn, prompt, codegenPrompt.options);\\n\\n // Execute the context optimization step\\n if (!codegenPrompt.options.disableContextOptimization) {\\n const optimizationResult = await executeStepContextOptimization(generateContentFn, prompt, codegenPrompt.options);\\n\\n if (optimizationResult === StepResult.BREAK) {\\n return { result: [], prompt };\\n }\\n }\\n\\n // Execute the ask question step\\n if (codegenPrompt.options.askQuestion !== false && (codegenPrompt.options.interactive || codegenPrompt.options.ui)) {\\n const askQuestionResult = await executeStepAskQuestion(\\n generateContentFn,\\n generateImageFn,\\n prompt,\\n getFunctionDefs(),\\n codegenPrompt.options.temperature ?? 0.7,\\n messages,\\n codegenPrompt.options,\\n );\\n\\n // Summary based on the ask-question conversation history (may be different from the initial summary)\\n await executeStepGenerateSummary(generateContentFn, prompt, codegenPrompt.options);\\n\\n if (askQuestionResult === StepResult.BREAK) {\\n return { result: [], prompt };\\n }\\n } else if (codegenPrompt.options.askQuestion === false) {\\n console.log('Ask question is not enabled.');\\n // Also there is no need to generate conversation summary\\n }\\n\\n const baseRequest: [PromptItem[], FunctionDef[], string, number, boolean, CodegenOptions] = [\\n prompt,\\n getFunctionDefs(),\\n 'codegenSummary',\\n codegenPrompt.options.temperature ?? 0.7,\\n codegenPrompt.options.cheap ?? false,\\n codegenPrompt.options,\\n ];\\n let baseResult = await generateContentFn(...baseRequest);\\n\\n let codegenSummaryRequest = baseResult.find((call) => call.name === 'codegenSummary');\\n\\n if (codegenSummaryRequest) {\\n // Second stage: for each file request the actual code updates\\n putSystemMessage('Received codegen summary, will collect partial updates', codegenSummaryRequest.args);\\n\\n baseResult = await validateAndRecoverSingleResult(baseRequest, baseResult, generateContentFn);\\n codegenSummaryRequest = baseResult.find((call) => call.name === 'codegenSummary');\\n\\n // Sometimes the result happens to be a string\\n assert(Array.isArray(codegenSummaryRequest?.args?.fileUpdates), 'fileUpdates is not an array');\\n assert(Array.isArray(codegenSummaryRequest?.args.contextPaths), 'contextPaths is not an array');\\n\\n if (!codegenPrompt.options.disableContextOptimization) {\\n console.log('Optimize with context paths.');\\n // Monkey patch the initial getSourceCode, do not send parts of source code that are consider irrelevant\\n getSourceCodeRequest.args = {\\n filePaths: [\\n ...codegenSummaryRequest.args.fileUpdates.map((file: { filePath: string }) => file.filePath),\\n ...codegenSummaryRequest.args.contextPaths,\\n ...(importantContext.files ?? []),\\n ],\\n };\\n getSourceCodeResponse.functionResponses!.find((item) => item.name === 'getSourceCode')!.content =\\n messages.contextSourceCode(getSourceCodeRequest.args?.filePaths as string[]);\\n }\\n\\n // Store the first stage response entirely in conversation history\\n prompt.push({ type: 'assistant', functionCalls: baseResult });\\n prompt.push({\\n type: 'user',\\n functionResponses: baseResult.map((call) => ({ name: call.name, call_id: call.id })),\\n cache: true,\\n });\\n\\n const result: FunctionCall[] = [];\\n\\n for (const file of codegenSummaryRequest!.args.fileUpdates) {\\n putSystemMessage('Collecting partial update for: ' + file.filePath + ' using tool: ' + file.updateToolName, file);\\n console.log('- Prompt:', file.prompt);\\n console.log('- Temperature', file.temperature);\\n console.log('- Cheap', file.cheap);\\n if (codegenPrompt.options.vision) {\\n console.log('- Context image assets', file.contextImageAssets);\\n }\\n\\n // Check if execution is paused before proceeding\\n await waitIfPaused();\\n\\n // this is needed, otherwise we will get an error\\n if (prompt.slice(-1)[0].type === 'user') {\\n prompt.slice(-1)[0].text = file.prompt ?? messages.partialPromptTemplate(file.filePath);\\n } else {\\n prompt.push({ type: 'user', text: file.prompt ?? messages.partialPromptTemplate(file.filePath) });\\n }\\n\\n if (codegenPrompt.options.vision && file.contextImageAssets) {\\n prompt.slice(-1)[0].images = file.contextImageAssets.map((path: string) => ({\\n path,\\n base64url: fs.readFileSync(path, 'base64'),\\n mediaType: mime.lookup(path) || '',\\n }));\\n }\\n\\n const partialRequest: [PromptItem[], FunctionDef[], string, number, boolean, CodegenOptions] = [\\n prompt,\\n getFunctionDefs(),\\n file.updateToolName,\\n file.temperature ?? codegenPrompt.options.temperature,\\n file.cheap === true,\\n codegenPrompt.options,\\n ];\\n let partialResult = await generateContentFn(...partialRequest);\\n\\n putSystemMessage('Received partial update', partialResult);\\n\\n // Validate if function call is compliant with the schema\\n partialResult = await validateAndRecoverSingleResult(partialRequest, partialResult, generateContentFn);\\n\\n // Handle image generation requests\\n const generateImageCall = partialResult.find((call) => call.name === 'generateImage');\\n if (generateImageCall) {\\n partialResult.push(await executeStepGenerateImage(generateImageFn, generateImageCall));\\n }\\n\\n // Verify if patchFile is one of the functions called, and test if patch is valid and can be applied successfully\\n const patchFileCall = partialResult.find((call) => call.name === 'patchFile');\\n if (patchFileCall) {\\n partialResult = await executeStepVerifyPatch(\\n patchFileCall.args as { filePath: string; patch: string },\\n generateContentFn,\\n prompt,\\n getFunctionDefs(),\\n file.temperature ?? codegenPrompt.options.temperature,\\n file.cheap === true,\\n codegenPrompt.options,\\n );\\n }\\n\\n // add the code gen result to the context, as the subsequent code gen may depend on the result\\n prompt.push(\\n { type: 'assistant', functionCalls: partialResult },\\n {\\n type: 'user',\\n text: 'Update applied.',\\n functionResponses: partialResult.map((call) => ({ name: call.name, call_id: call.id })),\\n },\\n );\\n\\n result.push(...partialResult);\\n }\\n\\n return { result, prompt };\\n } else {\\n // This is unexpected, if happens probably means no code updates.\\n putSystemMessage('Did not receive codegen summary, returning result.');\\n return { result: baseResult, prompt };\\n }\\n}\\n\\n/**\\n * Function to prepare messages for AI services\\n */\\nfunction prepareMessages(codegen: CodegenPrompt) {\\n return {\\n suggestSourceCode: 'I should provide you with application source code.',\\n requestSourceCode: 'Please provide application source code.',\\n suggestImageAssets: 'I should also provide you with a summary of application image assets',\\n requestImageAssets: 'Please provide summary of application image assets.',\\n prompt:\\n codegen.prompt +\\n '\\\\n Start from generating codegen summary, this summary will be used as a context to generate updates, so make sure that it contains useful information.',\\n sourceCode: JSON.stringify(\\n getSourceCodeTree(getSourceCode({ taskFile: codegen.options.taskFile }, codegen.options)),\\n ),\\n contextSourceCode: (paths: string[], pathsOnly: boolean = false) =>\\n JSON.stringify(\\n getSourceCodeTree(\\n Object.fromEntries(\\n Object.entries(\\n getSourceCode(\\n { filterPaths: paths, taskFile: codegen.options.taskFile, forceAll: true },\\n codegen.options,\\n ),\\n ).filter(([path]) => !pathsOnly || paths.includes(path)),\\n ),\\n ),\\n ),\\n imageAssets: JSON.stringify(getImageAssets()),\\n partialPromptTemplate(path: string) {\\n return `Thank you for providing the summary, now suggest changes for the \\\\`${path}\\\\` file using appropriate tools.`;\\n },\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.ts\":{\"content\":\"import { putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';\\n\\nexport async function handleCancelCodeGeneration({ askQuestionCall }: ActionHandlerProps): Promise<ActionResult> {\\n putSystemMessage('Assistant requested to stop code generation. Exiting...');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [] },\\n user: { type: 'user', text: 'Code generation cancelled.' },\\n },\\n ],\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.ts\":{\"content\":\"import { putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { askUserForConfirmationWithAnswer } from '../../../../main/common/user-actions.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';\\n\\nexport async function handleConfirmCodeGeneration({\\n askQuestionCall,\\n options,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n const userConfirmation = await askUserForConfirmationWithAnswer(\\n 'The assistant is ready to start code generation. Do you want to proceed?',\\n 'Start code generation',\\n 'Continue conversation',\\n true,\\n );\\n if (userConfirmation.options?.aiService) {\\n options.aiService = userConfirmation.options.aiService;\\n }\\n if (userConfirmation.confirmed) {\\n putSystemMessage('Proceeding with code generation.');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [] },\\n user: { type: 'user', text: userConfirmation.answer || 'Confirmed. Proceed with code generation.' },\\n },\\n ],\\n };\\n } else {\\n putSystemMessage('Declined. Continuing the conversation.');\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [askQuestionCall] },\\n user: {\\n type: 'user',\\n text: userConfirmation.answer || 'Declined. Please continue the conversation.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n },\\n ],\\n };\\n }\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/context-optimization.ts\":{\"content\":\"import { refreshFiles } from '../../../../files/find-files.js';\\nimport { putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { askUserForConfirmation } from '../../../../main/common/user-actions.js';\\nimport { executeStepContextOptimization } from '../../step-context-optimization.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult, UserItem, AssistantItem } from '../step-ask-question-types.js';\\n\\nexport async function handleContextOptimization({\\n askQuestionCall,\\n prompt,\\n options,\\n generateContentFn,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n const userConfirmation = await askUserForConfirmation(\\n 'The assistant suggests optimizing the context to reduce token usage, cost, and latency. Do you want to proceed?',\\n false,\\n );\\n\\n const user: UserItem = {\\n type: 'user',\\n text: userConfirmation ? 'Context optimization applied.' : 'Context optimization not applied.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n };\\n\\n const assistant: AssistantItem = {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall],\\n };\\n\\n if (userConfirmation) {\\n // the request may be caused be an appearance of a new file, so lets refresh\\n refreshFiles();\\n\\n // Execute context optimization step\\n putSystemMessage('Executing context optimization step.');\\n await executeStepContextOptimization(generateContentFn, [...prompt, assistant, user], options);\\n }\\n\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant,\\n user,\\n },\\n ],\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/default-action.ts\":{\"content\":\"import { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';\\n\\nexport async function handleDefaultAction({ askQuestionCall }: ActionHandlerProps): Promise<ActionResult> {\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [askQuestionCall] },\\n user: {\\n type: 'user',\\n text: \\\"I don't want to start the code generation yet, let's talk a bit more.\\\",\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n },\\n ],\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.ts\":{\"content\":\"import { askUserForInput } from '../../../../main/common/user-actions.js';\\nimport { putAssistantMessage, putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult, RequestAnswerWithImageArgs } from '../step-ask-question-types.js';\\nimport { executeStepGenerateImage } from '../../step-generate-image.js';\\nimport { getFunctionDefs } from '../../../function-calling.js';\\nimport { FunctionCall } from '../../../../ai-service/common.js';\\n\\nexport async function handleRequestAnswerWithImage({\\n askQuestionCall,\\n options,\\n generateContentFn,\\n prompt,\\n generateImageFn,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n if (!options.imagen) {\\n putSystemMessage('Image generation is not enabled. Please enable it using --imagen parameter.');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n const [requestAnswerWithImageCall] = (await generateContentFn(\\n [\\n ...prompt,\\n {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall],\\n },\\n {\\n type: 'user',\\n text: 'Yes, you can request the files contents.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n ],\\n getFunctionDefs(),\\n 'requestAnswerWithImage',\\n 0.7,\\n true,\\n options,\\n )) as [FunctionCall<RequestAnswerWithImageArgs> | undefined];\\n\\n if (!requestAnswerWithImageCall) {\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n // Get the image generation request from the args\\n const imageGenerationRequest = requestAnswerWithImageCall.args;\\n if (!imageGenerationRequest?.prompt) {\\n putSystemMessage('Image generation request with prompt is required for requestAnswerWithImage action.');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n // Create a temporary file path for the generated image\\n const tempImagePath = `/tmp/question-image-${Date.now()}.png`;\\n\\n // Generate the image using generateImage function call\\n const generateImageCall = {\\n name: 'generateImage',\\n args: {\\n prompt: imageGenerationRequest.prompt,\\n filePath: tempImagePath,\\n width: 1024,\\n height: 1024,\\n explanation: 'Generating image to support the question',\\n ...(imageGenerationRequest.contextImage && { contextImagePath: imageGenerationRequest.contextImage }),\\n },\\n };\\n\\n // Execute image generation\\n const downloadFileCall = await executeStepGenerateImage(generateImageFn, generateImageCall);\\n\\n // If image generation failed, the downloadFileCall will be an explanation\\n if (!downloadFileCall.args?.downloadUrl) {\\n putSystemMessage('Failed to generate image for the question.');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n const response = await fetch(downloadFileCall.args?.downloadUrl);\\n const arrayBuffer = await response.arrayBuffer();\\n const buffer = Buffer.from(arrayBuffer);\\n\\n putAssistantMessage(\\n 'Here is the image to support the question:',\\n generateImageCall.args,\\n [],\\n [\\n {\\n base64url: buffer.toString('base64'),\\n mediaType: 'image/png',\\n },\\n ],\\n );\\n\\n // Get user's response with the image displayed\\n const inputResponse = await askUserForInput('Your answer', askQuestionCall.args?.content ?? '');\\n if (inputResponse.options?.aiService) {\\n options.aiService = inputResponse.options.aiService;\\n }\\n\\n // Return the conversation items with the generated image\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall, generateImageCall, downloadFileCall],\\n },\\n user: {\\n type: 'user',\\n text: inputResponse.answer,\\n functionResponses: [\\n {\\n name: 'askQuestion',\\n call_id: askQuestionCall.id,\\n content: undefined,\\n },\\n ],\\n },\\n },\\n ],\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handle-request-answer.ts\":{\"content\":\"import { askUserForInput } from '../../../../main/common/user-actions.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';\\n\\nexport async function handleRequestAnswer({ askQuestionCall, options }: ActionHandlerProps): Promise<ActionResult> {\\n const response = await askUserForInput('Your answer', askQuestionCall.args?.content ?? '');\\n if (response.options?.aiService) {\\n options.aiService = response.options.aiService;\\n }\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [askQuestionCall] },\\n user: {\\n type: 'user',\\n text: response.answer,\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n },\\n ],\\n };\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/handler-utils.ts\":{\"content\":\"\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.ts\":{\"content\":\"import { FunctionCall, PromptItem } from '../../../../ai-service/common.js';\\nimport { getSourceCodeTree, parseSourceCodeTree } from '../../../../files/source-code-tree.js';\\nimport { putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { getFunctionDefs } from '../../../function-calling.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { getSourceCodeResponse } from '../../steps-utils.js';\\nimport { ActionHandlerProps, ActionResult, RemoveFilesFromContextArgs } from '../step-ask-question-types.js';\\n\\nexport async function handleRemoveFilesFromContext({\\n askQuestionCall,\\n generateContentFn,\\n prompt,\\n options,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n const [removeFilesFromContextCall] = (await generateContentFn(\\n [\\n ...prompt,\\n {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall],\\n },\\n {\\n type: 'user',\\n text: 'Yes, you can request the removal of files from context.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n ],\\n getFunctionDefs(),\\n 'removeFilesFromContext',\\n 0.7,\\n true,\\n options,\\n )) as [FunctionCall<RemoveFilesFromContextArgs> | undefined];\\n\\n if (!removeFilesFromContextCall) {\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n const filesToRemove = removeFilesFromContextCall.args?.filePaths ?? [];\\n let userText = '';\\n\\n if (filesToRemove.length > 0) {\\n removeFileContentsFromPrompt(prompt, filesToRemove);\\n putSystemMessage('Context reduction applied', filesToRemove);\\n userText = 'Context reduction applied';\\n } else {\\n userText = 'No specific files were provided for context reduction. The context remains unchanged.';\\n }\\n\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall, removeFilesFromContextCall],\\n },\\n user: {\\n type: 'user',\\n text: userText,\\n functionResponses: [\\n { name: 'askQuestion', call_id: askQuestionCall.id, content: undefined },\\n { name: 'removeFilesFromContext', call_id: removeFilesFromContextCall.id, content: undefined },\\n ],\\n },\\n },\\n ],\\n };\\n}\\n\\nfunction removeFileContentsFromPrompt(prompt: PromptItem[], filesToRemove: string[]) {\\n const response = getSourceCodeResponse(prompt);\\n if (!response || !response.content) {\\n throw new Error('Could not find source code response');\\n }\\n const contentObj = parseSourceCodeTree(JSON.parse(response.content));\\n filesToRemove.forEach((file) => {\\n if (contentObj[file] && 'content' in contentObj[file]) {\\n contentObj[file].content = null;\\n }\\n });\\n response.content = JSON.stringify(getSourceCodeTree(contentObj));\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/request-files-content.ts\":{\"content\":\"import { FunctionCall } from '../../../../ai-service/common.js';\\nimport { getSourceFiles, refreshFiles } from '../../../../files/find-files.js';\\nimport { getSourceCode } from '../../../../files/read-files.js';\\nimport { getFunctionDefs } from '../../../function-calling.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport {\\n ActionHandlerProps,\\n ActionResult,\\n AssistantItem,\\n RequestFilesContentArgs,\\n UserItem,\\n} from '../step-ask-question-types.js';\\n\\nexport async function handleRequestFilesContent({\\n askQuestionCall,\\n options,\\n prompt,\\n generateContentFn,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n const [requestFilesContentCall] = (await generateContentFn(\\n [\\n ...prompt,\\n {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall],\\n },\\n {\\n type: 'user',\\n text: 'Yes, you can request the files contents.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n ],\\n getFunctionDefs(),\\n 'requestFilesContent',\\n 0.7,\\n true,\\n options,\\n )) as [FunctionCall<RequestFilesContentArgs> | undefined];\\n\\n if (!requestFilesContentCall) {\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n const requestedFiles = requestFilesContentCall.args?.filePaths ?? [];\\n\\n // the request may be caused be an appearance of a new file, so lets refresh\\n refreshFiles();\\n\\n const { legitimateFiles, illegitimateFiles } = categorizeLegitimateFiles(requestedFiles);\\n\\n const sourceCallId = (askQuestionCall.id ?? askQuestionCall.name) + '_source';\\n const assistant: AssistantItem = {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [\\n askQuestionCall,\\n requestFilesContentCall,\\n { name: 'getSourceCode', id: sourceCallId, args: { filePaths: legitimateFiles } },\\n ],\\n };\\n\\n const sourceCode = getSourceCode({ filterPaths: legitimateFiles, forceAll: true }, options);\\n const user: UserItem = {\\n type: 'user',\\n text:\\n illegitimateFiles.length > 0\\n ? `Some files are not legitimate and their content cannot be provided:\\\\n\\\\n${illegitimateFiles.join('\\\\n')}`\\n : 'All requested file contents have been provided.',\\n functionResponses: [\\n { name: 'askQuestion', call_id: askQuestionCall.id, content: undefined },\\n {\\n name: 'requestFilesContent',\\n call_id: requestFilesContentCall.id,\\n content: JSON.stringify({ filePaths: requestedFiles }),\\n },\\n {\\n name: 'getSourceCode',\\n call_id: sourceCallId,\\n content: JSON.stringify(sourceCode),\\n },\\n ],\\n cache: true,\\n };\\n\\n return { breakLoop: false, stepResult: StepResult.CONTINUE, items: [{ assistant, user }] };\\n}\\n\\nfunction categorizeLegitimateFiles(requestedFiles: string[]): {\\n legitimateFiles: string[];\\n illegitimateFiles: string[];\\n} {\\n const legitimateFiles: string[] = [];\\n const illegitimateFiles: string[] = [];\\n\\n requestedFiles.forEach((filePath) => {\\n if (isFilePathLegitimate(filePath)) {\\n legitimateFiles.push(filePath);\\n } else {\\n illegitimateFiles.push(filePath);\\n }\\n });\\n\\n return { legitimateFiles, illegitimateFiles };\\n}\\n\\nfunction isFilePathLegitimate(filePath: string): boolean {\\n return getSourceFiles().includes(filePath);\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/request-permissions.ts\":{\"content\":\"import { FunctionCall } from '../../../../ai-service/common.js';\\nimport { CodegenOptions } from '../../../../main/codegen-types.js';\\nimport { askUserForConfirmation } from '../../../../main/common/user-actions.js';\\nimport { getFunctionDefs } from '../../../function-calling.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult, RequestPermissionsArgs, UserItem } from '../step-ask-question-types.js';\\n\\nexport async function handleRequestPermissions({\\n askQuestionCall,\\n options,\\n prompt,\\n generateContentFn,\\n}: ActionHandlerProps): Promise<ActionResult> {\\n const [requestPermissionsCall] = (await generateContentFn(\\n [\\n ...prompt,\\n {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [askQuestionCall],\\n },\\n {\\n type: 'user',\\n text: 'Yes, you can request the permissions.',\\n functionResponses: [{ name: 'askQuestion', call_id: askQuestionCall.id, content: undefined }],\\n },\\n ],\\n getFunctionDefs(),\\n 'requestPermissions',\\n 0.7,\\n true,\\n options,\\n )) as [FunctionCall<RequestPermissionsArgs> | undefined];\\n\\n if (!requestPermissionsCall) {\\n return {\\n breakLoop: true,\\n stepResult: StepResult.BREAK,\\n items: [],\\n };\\n }\\n\\n const userConfirmation = await askUserForConfirmation(\\n 'The assistant is requesting additional permissions. Do you want to grant them?',\\n false,\\n );\\n\\n const user: UserItem = {\\n type: 'user',\\n text: userConfirmation ? 'Permissions granted.' : 'Permission request denied.',\\n functionResponses: [\\n { name: 'askQuestion', call_id: askQuestionCall.id, content: undefined },\\n {\\n name: 'requestPermissions',\\n call_id: requestPermissionsCall.id,\\n content: JSON.stringify({ confirmed: userConfirmation.confirmed }),\\n },\\n ],\\n };\\n\\n if (userConfirmation.confirmed) {\\n updatePermissions(requestPermissionsCall, options);\\n }\\n\\n return {\\n breakLoop: false,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: {\\n type: 'assistant',\\n text: askQuestionCall.args?.content ?? '',\\n functionCalls: [requestPermissionsCall, askQuestionCall],\\n },\\n user,\\n },\\n ],\\n };\\n}\\n\\nfunction updatePermissions(requestPermissionsCall: FunctionCall<RequestPermissionsArgs>, options: CodegenOptions) {\\n const permissions = requestPermissionsCall.args;\\n if (permissions) {\\n if ('enableImagen' in permissions && permissions.enableImagen) {\\n options.imagen = options.aiService === 'chat-gpt' ? 'dall-e' : 'vertex-ai';\\n }\\n if ('enableVision' in permissions && permissions.enableVision) options.vision = true;\\n if ('allowDirectoryCreate' in permissions && permissions.allowDirectoryCreate) options.allowDirectoryCreate = true;\\n if ('allowFileCreate' in permissions && permissions.allowFileCreate) options.allowFileCreate = true;\\n if ('allowFileDelete' in permissions && permissions.allowFileDelete) options.allowFileDelete = true;\\n if ('allowFileMove' in permissions && permissions.allowFileMove) options.allowFileMove = true;\\n }\\n}\\n\"},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers/start-code-generation.ts\":{\"content\":\"import { putSystemMessage } from '../../../../main/common/content-bus.js';\\nimport { StepResult } from '../../steps-types.js';\\nimport { ActionHandlerProps, ActionResult } from '../step-ask-question-types.js';\\n\\nexport async function handleStartCodeGeneration({ askQuestionCall }: ActionHandlerProps): Promise<ActionResult> {\\n putSystemMessage('Proceeding with code generation.');\\n return {\\n breakLoop: true,\\n stepResult: StepResult.CONTINUE,\\n items: [\\n {\\n assistant: { type: 'assistant', text: askQuestionCall.args?.content ?? '', functionCalls: [] },\\n user: { type: 'user', text: 'Proceeding with code generation.' },\\n },\\n ],\\n };\\n}\\n\"}}",
104
- // },
105
- // ],
106
- // cache: true,
107
- // },
108
- // {
109
- // type: 'assistant',
110
- // text: 'The assistant is ready to start code generation. Do you want to proceed?',
111
- // },
112
- // {
113
- // type: 'user',
114
- // text: 'Why do you want to start code generation?',
115
- // },
116
- // {
117
- // type: 'assistant',
118
- // text: 'The assistant is ready to start code generation. Do you want to proceed?',
119
- // },
120
- // {
121
- // type: 'user',
122
- // text: 'no, please analyze those files first, and say YOLO.',
123
- // },
124
- ];
125
- //# sourceMappingURL=prompt2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompt2.js","sourceRoot":"","sources":["../../src/eval/prompt2.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,eAAe,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;KACnG;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mBAAmB;KAC1B;IACD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,yKAAyK;QAC/K,aAAa,EAAE;YACb;gBACE,IAAI,EAAE,eAAe;aACtB;YACD;gBACE,IAAI,EAAE,gBAAgB;aACvB;SACF;KACF;IACD;QACE,IAAI,EAAE,MAAM;QACZ,iBAAiB,EAAE;YACjB;gBACE,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;oBACtB,yEAAyE,EAAE;wBACzE,2BAA2B,EAAE,EAAE,OAAO,EAAE,8CAA8C,EAAE;wBACxF,4BAA4B,EAAE,EAAE,OAAO,EAAE,yCAAyC,EAAE;wBACpF,yBAAyB,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;wBACtE,mBAAmB,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;wBAC1D,qCAAqC,EAAE;4BACrC,OAAO,EAAE,0DAA0D;yBACpE;wBACD,0BAA0B,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE;wBACvE,kBAAkB,EAAE,EAAE,OAAO,EAAE,kDAAkD,EAAE;wBACnF,8BAA8B,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;wBAClF,0BAA0B,EAAE,EAAE,OAAO,EAAE,6CAA6C,EAAE;wBACtF,wBAAwB,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE;wBACjF,0BAA0B,EAAE,EAAE,OAAO,EAAE,uCAAuC,EAAE;qBACjF;iBACF,CAAC;aACH;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EACL,qUAAqU;aACxU;SACF;QACD,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,6DAA6D;KACpE;IACD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,uDAAuD;KAC9D;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO;KACd;IACD;QACE,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,oCAAoC;KAC3C;IACD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qKAAqK;KAC5K;IACD,MAAM;IACN,yBAAyB;IACzB,ubAAub;IACvb,uBAAuB;IACvB,UAAU;IACV,iCAAiC;IACjC,uDAAuD;IACvD,kBAAkB;IAClB,yBAAyB;IACzB,mHAAmH;IACnH,oHAAoH;IACpH,iHAAiH;IACjH,2GAA2G;IAC3G,6HAA6H;IAC7H,kHAAkH;IAClH,0GAA0G;IAC1G,sHAAsH;IACtH,kHAAkH;IAClH,gHAAgH;IAChH,kHAAkH;IAClH,eAAe;IACf,aAAa;IACb,WAAW;IACX,SAAS;IACT,OAAO;IACP,MAAM;IACN,oBAAoB;IACpB,+DAA+D;IAC/D,2BAA2B;IAC3B,UAAU;IACV,iCAAiC;IACjC,4DAA4D;IAC5D,mBAAmB;IACnB,uygDAAuygD;IACvygD,WAAW;IACX,SAAS;IACT,mBAAmB;IACnB,OAAO;IACP,MAAM;IACN,yBAAyB;IACzB,wFAAwF;IACxF,OAAO;IACP,MAAM;IACN,oBAAoB;IACpB,yDAAyD;IACzD,OAAO;IACP,MAAM;IACN,yBAAyB;IACzB,wFAAwF;IACxF,OAAO;IACP,MAAM;IACN,oBAAoB;IACpB,mEAAmE;IACnE,OAAO;CACR,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from '../../src/main/codegen-types.js';
2
- declare const fakeAiService: Plugin;
3
- export default fakeAiService;
@@ -1,11 +0,0 @@
1
- const fakeAiService = {
2
- name: 'fake-ai-service',
3
- aiServices: {
4
- 'fake-ai-service': async (...args) => {
5
- console.log('FAKE AI SERVICE CALLED', ...args);
6
- return [];
7
- },
8
- },
9
- };
10
- export default fakeAiService;
11
- //# sourceMappingURL=fake_ai_service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fake_ai_service.js","sourceRoot":"","sources":["../../../examples/genaicode_plugins/fake_ai_service.ts"],"names":[],"mappings":"AAGA,MAAM,aAAa,GAAW;IAC5B,IAAI,EAAE,iBAAiB;IACvB,UAAU,EAAE;QACV,iBAAiB,EAAE,KAAK,EAAE,GAAG,IAAyB,EAA2B,EAAE;YACjF,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,GAAG,IAAI,CAAC,CAAC;YAC/C,OAAO,EAAE,CAAC;QACZ,CAAC;KACF;CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from '../../src/main/codegen-types.js';
2
- declare const grokAiService: Plugin;
3
- export default grokAiService;
@@ -1,153 +0,0 @@
1
- import OpenAI, { APIError } from 'openai';
2
- import assert from 'node:assert';
3
- import { printTokenUsageAndCost, processFunctionCalls, } from '../../src/ai-service/common.js';
4
- import { abortController } from '../../src/main/interactive/codegen-worker.js';
5
- import { modelOverrides } from '../../src/main/config.js';
6
- const grokAiService = {
7
- name: 'grok-ai-service',
8
- aiServices: {
9
- 'grok-ai-service': generateContent,
10
- },
11
- };
12
- async function generateContent(prompt, functionDefs, requiredFunctionName, temperature, cheap = false) {
13
- const openai = new OpenAI({
14
- apiKey: process.env.GROK_OPENAI_API_KEY,
15
- baseURL: 'https://api.x.ai/v1',
16
- });
17
- const messages = prompt
18
- .map((item) => {
19
- if (item.type === 'systemPrompt') {
20
- return {
21
- role: 'system',
22
- content: item.systemPrompt,
23
- };
24
- }
25
- else if (item.type === 'user') {
26
- const messages = [];
27
- if (item.functionResponses) {
28
- messages.push(...item.functionResponses.map((response) => ({
29
- role: 'tool',
30
- name: response.name,
31
- content: response.content ?? '',
32
- tool_call_id: response.name,
33
- })));
34
- }
35
- if ((item.images?.length ?? 0) > 0) {
36
- messages.push({
37
- role: 'user',
38
- content: [
39
- ...item.images.map((image) => ({
40
- type: 'image_url',
41
- image_url: {
42
- url: 'data:' + image.mediaType + ';base64,' + image.base64url,
43
- },
44
- })),
45
- {
46
- type: 'text',
47
- text: item.text,
48
- },
49
- ],
50
- });
51
- }
52
- else {
53
- messages.push({
54
- role: 'user',
55
- content: item.text,
56
- });
57
- }
58
- return messages;
59
- }
60
- else {
61
- assert(item.type === 'assistant');
62
- const message = {
63
- role: 'assistant',
64
- ...(item.text ? { content: item.text } : {}),
65
- tool_calls: item.functionCalls?.map((call) => ({
66
- type: 'function',
67
- function: { name: call.name, arguments: JSON.stringify(call.args ?? {}) },
68
- id: call.name,
69
- })),
70
- };
71
- return message;
72
- }
73
- })
74
- .flat();
75
- const defaultModel = cheap ? 'grok-2-mini' : 'grok-beta';
76
- const model = cheap
77
- ? (modelOverrides.chatGpt?.cheap ?? defaultModel)
78
- : (modelOverrides.chatGpt?.default ?? defaultModel);
79
- console.log(`Using OpenAI model: ${model}`);
80
- assert(process.env.OPENAI_API_KEY, 'OPENAI_API_KEY environment variable is not set');
81
- let retryCount = 0;
82
- const maxRetries = 3;
83
- let response = undefined;
84
- while (retryCount < maxRetries) {
85
- try {
86
- response = await openai.chat.completions.create({
87
- model: model,
88
- messages,
89
- tools: functionDefs.map((funDef) => ({ type: 'function', function: funDef })),
90
- tool_choice: requiredFunctionName
91
- ? { type: 'function', function: { name: requiredFunctionName } }
92
- : 'required',
93
- temperature: temperature,
94
- }, { signal: abortController?.signal });
95
- break; // Exit loop if successful
96
- }
97
- catch (error) {
98
- if (error instanceof APIError && error.status === 429) {
99
- // Rate limit error
100
- let retryAfter = error.headers?.['retry-after'] ? parseInt(error.headers['retry-after'], 10) : 60;
101
- retryAfter = Math.min(retryAfter, 30);
102
- console.log(`Rate limited. Retrying after ${retryAfter} seconds. Attempt ${retryCount + 1} of ${maxRetries}.`);
103
- await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
104
- retryCount++;
105
- }
106
- else {
107
- console.error('An error occurred:', error);
108
- throw new Error('API request failed. Operation aborted.');
109
- }
110
- }
111
- }
112
- if (retryCount === maxRetries) {
113
- console.error(`Failed to complete request after ${maxRetries} attempts due to rate limiting.`);
114
- throw new Error('Rate limit exceeded. Operation aborted.');
115
- }
116
- assert(response);
117
- // Print token usage for chat gpt
118
- const usage = {
119
- inputTokens: response.usage.prompt_tokens - (response.usage?.prompt_tokens_details?.cached_tokens ?? 0),
120
- outputTokens: response.usage.completion_tokens,
121
- totalTokens: response.usage.total_tokens,
122
- cacheReadTokens: response.usage?.prompt_tokens_details?.cached_tokens,
123
- };
124
- printTokenUsageAndCost({
125
- aiService: 'chat-gpt',
126
- usage,
127
- inputCostPerToken: 0.000005,
128
- outputCostPerToken: 0.000015,
129
- cheap,
130
- });
131
- const responseMessage = response.choices[0].message;
132
- if (responseMessage.content) {
133
- console.log('Message', responseMessage.content);
134
- }
135
- const toolCalls = responseMessage.tool_calls;
136
- if (toolCalls) {
137
- const functionCalls = toolCalls.map((call) => {
138
- const name = call.function.name;
139
- const args = JSON.parse(call.function.arguments);
140
- return {
141
- id: call.id,
142
- name,
143
- args,
144
- };
145
- });
146
- return processFunctionCalls(functionCalls, functionDefs);
147
- }
148
- else {
149
- throw new Error('No tool calls found in response');
150
- }
151
- }
152
- export default grokAiService;
153
- //# sourceMappingURL=grok_ai_service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grok_ai_service.js","sourceRoot":"","sources":["../../../examples/genaicode_plugins/grok_ai_service.ts"],"names":[],"mappings":"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"}
@@ -1,3 +0,0 @@
1
- import { Plugin } from '../../src/main/codegen-types';
2
- declare const fakeAiService: Plugin;
3
- export default fakeAiService;
@@ -1,23 +0,0 @@
1
- const fakeAiService = {
2
- name: 'nonsense-operation',
3
- operations: {
4
- 'nonsense-operation': {
5
- executor: async (args) => {
6
- console.log('NONSE OPERATION EXECUTED', args);
7
- },
8
- def: {
9
- name: 'nonsense',
10
- description: 'nonsense operation',
11
- parameters: {
12
- type: 'object',
13
- properties: {
14
- input: { type: 'string' },
15
- },
16
- required: ['input'],
17
- },
18
- },
19
- },
20
- },
21
- };
22
- export default fakeAiService;
23
- //# sourceMappingURL=nonsense_operation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nonsense_operation.js","sourceRoot":"","sources":["../../../examples/genaicode_plugins/nonsense_operation.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAW;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,UAAU,EAAE;QACV,oBAAoB,EAAE;YACpB,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACvB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;YAChD,CAAC;YACD,GAAG,EAAE;gBACH,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,oBAAoB;gBACjC,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAC1B;oBACD,QAAQ,EAAE,CAAC,OAAO,CAAC;iBACpB;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-file.d.ts","sourceRoot":"","sources":["../../src/files/cache-file.ts"],"names":[],"mappings":"AASA,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAG5D;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAIzD;AAoBD,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../src/files/file-utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGxE"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { vi, describe, beforeEach, it, expect } from 'vitest';
2
- import { isAncestorDirectory } from './file-utils.js';
3
- // Test for isAncestorDirectory
4
- describe('isAncestorDirectory', () => {
5
- beforeEach(() => {
6
- vi.resetAllMocks();
7
- });
8
- it('should return true if directories are the same', () => {
9
- expect(isAncestorDirectory('/project', '/project')).toBe(true);
10
- });
11
- it('should return true if parent is ancestor of dir', () => {
12
- expect(isAncestorDirectory('/project', '/project/src')).toBe(true);
13
- });
14
- it('should return false if parent is not ancestor of dir', () => {
15
- expect(isAncestorDirectory('/project', '/other')).toBe(false);
16
- });
17
- });
18
- //# sourceMappingURL=file-utils.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-utils.test.js","sourceRoot":"","sources":["../../src/files/file-utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,+BAA+B;AAC/B,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,UAAU,CAAC,GAAG,EAAE;QACd,EAAE,CAAC,aAAa,EAAE,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-files.d.ts","sourceRoot":"","sources":["../../src/files/find-files.ts"],"names":[],"mappings":"AASA,KAAK,cAAc,GAAG,MAAM,EAAE,CAAC;AAkD/B,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CAgBnE;AAQD,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAGD,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED,wBAAgB,YAAY,SAG3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../src/files/path-utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAYvD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-files.d.ts","sourceRoot":"","sources":["../../src/files/read-files.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO1D,MAAM,WAAW,cAAc;IAE7B,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,OAAO,GAAG,UAAU,CAAC;CAC5B;AAKD,MAAM,WAAW,WAAW;IAE1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;CACjC;AAKD,MAAM,WAAW,WAAW;IAE1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;CACjC;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;AAEtE,KAAK,cAAc,GAAG,MAAM,CAC1B,MAAM,EACN;IACE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CACF,CAAC;AAoEF,wBAAgB,aAAa,CAC3B,EACE,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,oBAAoB,GACrB,EAAE;IACD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,EACD,OAAO,EAAE,cAAc,GACtB,aAAa,CAWf;AAGD,wBAAgB,cAAc,IAAI,cAAc,CAY/C"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,95 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
- import fs from 'fs';
3
- import mime from 'mime-types';
4
- import sizeOf from 'image-size';
5
- import { getSourceCode, getImageAssets } from './read-files.js';
6
- import { getSourceFiles, getImageAssetFiles } from './find-files.js';
7
- import { verifySourceCodeLimit } from '../prompt/limits.js';
8
- import * as cliParams from '../cli/cli-params.js';
9
- import { rcConfig } from '../main/config.js';
10
- import { getSummary } from '../prompt/steps/step-summarization.js';
11
- vi.mock('fs');
12
- vi.mock('mime-types');
13
- vi.mock('image-size');
14
- vi.mock('../prompt/steps/step-summarization.js');
15
- vi.mock('./find-files.js', () => ({
16
- getImageAssetFiles: vi.fn(),
17
- getSourceFiles: vi.fn(),
18
- }));
19
- vi.mock('../prompt/limits.js');
20
- vi.mock('../cli/cli-params.js', () => ({
21
- taskFile: null,
22
- contentMask: null,
23
- disableExplanations: true,
24
- ignorePatterns: [],
25
- }));
26
- vi.mock('../main/config.js', () => ({
27
- rcConfig: { rootDir: '/home/project' },
28
- importantContext: {},
29
- }));
30
- describe('read-files', () => {
31
- beforeEach(() => {
32
- vi.resetAllMocks();
33
- vi.mocked(cliParams).contentMask = undefined;
34
- vi.mocked(getSummary).mockImplementation((file) => ({ summary: `Summary of ${file}`, dependencies: [] }));
35
- });
36
- afterEach(() => {
37
- vi.clearAllMocks();
38
- });
39
- describe('getSourceCode', () => {
40
- it('should return source code summaries for all files', () => {
41
- const mockFiles = ['/home/project/file1.js', '/home/project/file2.js'];
42
- vi.mocked(getSourceFiles).mockReturnValue(mockFiles);
43
- vi.mocked(fs).existsSync.mockReturnValue(true);
44
- vi.mocked(fs).readFileSync.mockImplementation((file) => `Content of ${file}`);
45
- rcConfig.rootDir = '/home/project';
46
- const result = getSourceCode({ taskFile: undefined }, { aiService: 'vertex-ai', askQuestion: false });
47
- expect(result).toEqual({
48
- '/home/project/file1.js': { summary: 'Summary of /home/project/file1.js' },
49
- '/home/project/file2.js': { summary: 'Summary of /home/project/file2.js' },
50
- });
51
- expect(verifySourceCodeLimit).toHaveBeenCalled();
52
- });
53
- it('should apply content mask when specified', () => {
54
- const mockFiles = ['/home/project/file1.js', '/home/project/subfolder/file2.js'];
55
- vi.mocked(getSourceFiles).mockReturnValue(mockFiles);
56
- vi.mocked(fs).existsSync.mockReturnValue(true);
57
- vi.mocked(fs).readFileSync.mockImplementation((file) => `Content of ${file}`);
58
- rcConfig.rootDir = '/home/project';
59
- const result = getSourceCode({ taskFile: undefined }, { aiService: 'vertex-ai', contentMask: 'subfolder', askQuestion: false });
60
- expect(result).toEqual({
61
- '/home/project/file1.js': { summary: 'Summary of /home/project/file1.js' },
62
- '/home/project/subfolder/file2.js': {
63
- summary: 'Summary of /home/project/subfolder/file2.js',
64
- },
65
- });
66
- });
67
- it('should include task file when specified', () => {
68
- const mockFiles = ['/home/project/file1.js'];
69
- vi.mocked(getSourceFiles).mockReturnValue(mockFiles);
70
- vi.mocked(fs).existsSync.mockReturnValue(true);
71
- vi.mocked(fs).readFileSync.mockImplementation((file) => `Content of ${file}`);
72
- rcConfig.rootDir = '/home/project';
73
- const result = getSourceCode({ taskFile: '/home/project/task.md' }, { aiService: 'vertex-ai', askQuestion: false });
74
- expect(result).toEqual({
75
- '/home/project/file1.js': { summary: 'Summary of /home/project/file1.js' },
76
- '/home/project/task.md': { content: 'Content of /home/project/task.md' },
77
- });
78
- });
79
- });
80
- describe('getImageAssets', () => {
81
- it('should return image assets information', () => {
82
- const mockImageFiles = ['/home/project/image1.png', '/home/project/image2.jpg'];
83
- vi.mocked(getImageAssetFiles).mockReturnValue(mockImageFiles);
84
- vi.mocked(mime).lookup.mockImplementation((file) => (file.endsWith('.png') ? 'image/png' : 'image/jpeg'));
85
- vi.mocked(sizeOf).mockImplementation(() => ({ width: 100, height: 200 }));
86
- const result = getImageAssets();
87
- expect(result).toEqual({
88
- '/home/project/image1.png': { mimeType: 'image/png', width: 100, height: 200 },
89
- '/home/project/image2.jpg': { mimeType: 'image/jpeg', width: 100, height: 200 },
90
- });
91
- expect(verifySourceCodeLimit).toHaveBeenCalled();
92
- });
93
- });
94
- });
95
- //# sourceMappingURL=read-files.test.js.map