genaicode 0.8.6 → 0.9.1

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 (1014) 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 +22 -1
  37. package/dist/cli/cli-params.js.map +1 -1
  38. package/dist/cli/validate-cli-params.js +19 -11
  39. package/dist/cli/validate-cli-params.js.map +1 -1
  40. package/dist/files/read-files.d.ts +1 -28
  41. package/dist/files/read-files.js +9 -3
  42. package/dist/files/read-files.js.map +1 -1
  43. package/dist/files/source-code-tree.d.ts +5 -6
  44. package/dist/files/source-code-tree.js +3 -32
  45. package/dist/files/source-code-tree.js.map +1 -1
  46. package/dist/files/source-code-types.d.ts +31 -0
  47. package/dist/files/source-code-types.js +2 -0
  48. package/dist/files/source-code-types.js.map +1 -0
  49. package/dist/files/source-code-utils.d.ts +22 -0
  50. package/dist/files/source-code-utils.js +69 -0
  51. package/dist/files/source-code-utils.js.map +1 -0
  52. package/dist/files/summary-cache.d.ts +20 -0
  53. package/dist/files/summary-cache.js +15 -0
  54. package/dist/files/summary-cache.js.map +1 -0
  55. package/dist/files/update-files.d.ts +1 -1
  56. package/dist/help-docs/genaicode-help-document.d.ts +1 -0
  57. package/dist/help-docs/genaicode-help-document.js +286 -0
  58. package/dist/help-docs/genaicode-help-document.js.map +1 -0
  59. package/dist/index.d.ts +1 -3
  60. package/dist/index.js +1 -3
  61. package/dist/index.js.map +1 -1
  62. package/dist/main/codegen-types.d.ts +12 -10
  63. package/dist/main/codegen-utils.d.ts +1 -1
  64. package/dist/main/codegen.d.ts +4 -3
  65. package/dist/main/codegen.js.map +1 -1
  66. package/dist/main/codegen.test-utils.d.ts +1 -1
  67. package/dist/main/common/abort-controller.d.ts +2 -0
  68. package/dist/main/common/abort-controller.js +5 -0
  69. package/dist/main/common/abort-controller.js.map +1 -0
  70. package/dist/main/common/app-context-bus.d.ts +11 -0
  71. package/dist/main/common/app-context-bus.js +29 -0
  72. package/dist/main/common/app-context-bus.js.map +1 -0
  73. package/dist/main/common/content-bus-types.d.ts +1 -1
  74. package/dist/main/common/content-bus.d.ts +1 -1
  75. package/dist/main/common/cost-collector.d.ts +3 -2
  76. package/dist/main/common/cost-collector.js +3 -3
  77. package/dist/main/common/cost-collector.js.map +1 -1
  78. package/dist/main/common/user-actions.d.ts +3 -3
  79. package/dist/main/common/user-actions.js +19 -10
  80. package/dist/main/common/user-actions.js.map +1 -1
  81. package/dist/main/config-schema.js +10 -0
  82. package/dist/main/config-schema.js.map +1 -1
  83. package/dist/main/config-types.d.ts +22 -16
  84. package/dist/main/interactive/codegen-worker.d.ts +0 -1
  85. package/dist/main/interactive/codegen-worker.js +4 -3
  86. package/dist/main/interactive/codegen-worker.js.map +1 -1
  87. package/dist/main/interactive/select-ai-service.d.ts +1 -1
  88. package/dist/main/plugin-loader.d.ts +5 -3
  89. package/dist/main/plugin-loader.js.map +1 -1
  90. package/dist/main/ui/backend/endpoints/context-endpoint.js +67 -0
  91. package/dist/main/ui/backend/endpoints/context-endpoint.js.map +1 -0
  92. package/dist/main/ui/backend/endpoints/generate-content-endpoint.js +6 -4
  93. package/dist/main/ui/backend/endpoints/generate-content-endpoint.js.map +1 -1
  94. package/dist/main/ui/backend/endpoints/index.d.ts +1 -0
  95. package/dist/main/ui/backend/endpoints/index.js +1 -0
  96. package/dist/main/ui/backend/endpoints/index.js.map +1 -1
  97. package/dist/main/ui/backend/server.d.ts +2 -1
  98. package/dist/main/ui/backend/server.js +2 -1
  99. package/dist/main/ui/backend/server.js.map +1 -1
  100. package/dist/main/ui/backend/service.d.ts +29 -4
  101. package/dist/main/ui/backend/service.js +50 -10
  102. package/dist/main/ui/backend/service.js.map +1 -1
  103. package/dist/main/ui/codegen-ui.d.ts +5 -1
  104. package/dist/main/ui/codegen-ui.js +10 -1
  105. package/dist/main/ui/codegen-ui.js.map +1 -1
  106. package/dist/main/ui/common/api-types.d.ts +4 -51
  107. package/dist/main/ui/frontend/assets/favicon-DvroFOpS.png +0 -0
  108. package/dist/main/ui/frontend/assets/index-D8KFdZaU.js +1775 -0
  109. package/dist/main/ui/frontend/assets/wolf-bark-Bl17CX4O.mp3 +0 -0
  110. package/dist/main/ui/frontend/index.html +2 -2
  111. package/dist/operations/create-directory/create-directory-def.d.ts +1 -1
  112. package/dist/operations/create-file/create-file-def.d.ts +1 -1
  113. package/dist/operations/create-file/create-file-def.js +2 -1
  114. package/dist/operations/create-file/create-file-def.js.map +1 -1
  115. package/dist/operations/delete-file/delete-file-def.d.ts +1 -1
  116. package/dist/operations/download-file/download-file-def.d.ts +1 -1
  117. package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts +1 -1
  118. package/dist/operations/move-file/move-file-def.d.ts +1 -1
  119. package/dist/operations/patch-file/patch-file-def.d.ts +1 -1
  120. package/dist/operations/patch-file/patch-file-def.js +2 -1
  121. package/dist/operations/patch-file/patch-file-def.js.map +1 -1
  122. package/dist/operations/resize-image/resize-image-def.d.ts +1 -1
  123. package/dist/operations/split-image/split-image-def.d.ts +1 -1
  124. package/dist/operations/update-file/update-file-def.d.ts +1 -1
  125. package/dist/operations/update-file/update-file-def.js +2 -1
  126. package/dist/operations/update-file/update-file-def.js.map +1 -1
  127. package/dist/prompt/ai-service-fallback.d.ts +4 -3
  128. package/dist/prompt/ai-service-fallback.js +10 -58
  129. package/dist/prompt/ai-service-fallback.js.map +1 -1
  130. package/dist/prompt/function-calling-validate.d.ts +2 -2
  131. package/dist/prompt/function-calling-validate.js +5 -5
  132. package/dist/prompt/function-calling-validate.js.map +1 -1
  133. package/dist/prompt/function-calling.d.ts +1 -1
  134. package/dist/prompt/function-calling.js +12 -2
  135. package/dist/prompt/function-calling.js.map +1 -1
  136. package/dist/prompt/function-defs/analysis-result.d.ts +7 -0
  137. package/dist/prompt/function-defs/analysis-result.js +24 -0
  138. package/dist/prompt/function-defs/analysis-result.js.map +1 -0
  139. package/dist/prompt/function-defs/ask-question.d.ts +3 -2
  140. package/dist/prompt/function-defs/ask-question.js +93 -81
  141. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  142. package/dist/prompt/function-defs/codegen-planning.d.ts +1 -1
  143. package/dist/prompt/function-defs/codegen-planning.js +11 -1
  144. package/dist/prompt/function-defs/codegen-planning.js.map +1 -1
  145. package/dist/prompt/function-defs/codegen-summary.d.ts +1 -1
  146. package/dist/prompt/function-defs/codegen-summary.js +19 -10
  147. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  148. package/dist/prompt/function-defs/explanation.d.ts +1 -1
  149. package/dist/prompt/function-defs/genaicode-help.d.ts +6 -0
  150. package/dist/prompt/function-defs/genaicode-help.js +23 -0
  151. package/dist/prompt/function-defs/genaicode-help.js.map +1 -0
  152. package/dist/prompt/function-defs/generate-image.d.ts +1 -1
  153. package/dist/prompt/function-defs/get-image-assets.d.ts +1 -1
  154. package/dist/prompt/function-defs/get-source-code.d.ts +1 -1
  155. package/dist/prompt/function-defs/get-source-code.js +8 -11
  156. package/dist/prompt/function-defs/get-source-code.js.map +1 -1
  157. package/dist/prompt/function-defs/optimize-context.d.ts +1 -1
  158. package/dist/prompt/function-defs/optimize-context.js +1 -1
  159. package/dist/prompt/function-defs/optimize-context.js.map +1 -1
  160. package/dist/prompt/function-defs/perform-analysis.d.ts +8 -0
  161. package/dist/prompt/function-defs/perform-analysis.js +28 -0
  162. package/dist/prompt/function-defs/perform-analysis.js.map +1 -0
  163. package/dist/prompt/function-defs/read-history.d.ts +1 -1
  164. package/dist/prompt/function-defs/reasoning-inference.d.ts +3 -0
  165. package/dist/prompt/function-defs/reasoning-inference.js +39 -0
  166. package/dist/prompt/function-defs/reasoning-inference.js.map +1 -0
  167. package/dist/prompt/function-defs/set-summaries.d.ts +1 -1
  168. package/dist/prompt/function-defs/set-summaries.js +10 -6
  169. package/dist/prompt/function-defs/set-summaries.js.map +1 -1
  170. package/dist/prompt/function-defs/update-history.d.ts +1 -1
  171. package/dist/prompt/limits.js +1 -1
  172. package/dist/prompt/prompt-service.d.ts +5 -2
  173. package/dist/prompt/prompt-service.js +3 -5
  174. package/dist/prompt/prompt-service.js.map +1 -1
  175. package/dist/prompt/prompt-service.test-utils.d.ts +2 -2
  176. package/dist/prompt/prompt-service.test-utils.js +2 -1
  177. package/dist/prompt/prompt-service.test-utils.js.map +1 -1
  178. package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts +2 -0
  179. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js +11 -9
  180. package/dist/prompt/steps/step-ask-question/handlers/code-generation.js.map +1 -1
  181. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +1 -5
  182. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -1
  183. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +1 -5
  184. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -1
  185. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.d.ts +1 -0
  186. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js +251 -0
  187. package/dist/prompt/steps/step-ask-question/handlers/genaicode-help-document.js.map +1 -0
  188. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.d.ts +2 -0
  189. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js +157 -0
  190. package/dist/prompt/steps/step-ask-question/handlers/handle-create-file.js.map +1 -0
  191. package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.d.ts +2 -0
  192. package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js +30 -0
  193. package/dist/prompt/steps/step-ask-question/handlers/handle-end-conversation.js.map +1 -0
  194. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.d.ts +8 -0
  195. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js +91 -0
  196. package/dist/prompt/steps/step-ask-question/handlers/handle-genaicode-help.js.map +1 -0
  197. package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.d.ts +2 -0
  198. package/dist/prompt/steps/step-ask-question/handlers/{handle-send-message-with-image.js → handle-generate-image.js} +28 -29
  199. package/dist/prompt/steps/step-ask-question/handlers/handle-generate-image.js.map +1 -0
  200. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.d.ts +6 -0
  201. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js +99 -0
  202. package/dist/prompt/steps/step-ask-question/handlers/handle-perform-analysis.js.map +1 -0
  203. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.d.ts +9 -0
  204. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js +90 -0
  205. package/dist/prompt/steps/step-ask-question/handlers/handle-pull-app-context.js.map +1 -0
  206. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.d.ts +9 -0
  207. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js +91 -0
  208. package/dist/prompt/steps/step-ask-question/handlers/handle-push-app-context.js.map +1 -0
  209. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.d.ts +7 -0
  210. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js +97 -0
  211. package/dist/prompt/steps/step-ask-question/handlers/handle-reasoning-inference.js.map +1 -0
  212. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js +4 -4
  213. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.js.map +1 -1
  214. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js +1 -4
  215. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.js.map +1 -1
  216. package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js +92 -61
  217. package/dist/prompt/steps/step-ask-question/handlers/handle-update-file.js.map +1 -1
  218. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +17 -20
  219. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -1
  220. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +7 -1
  221. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +52 -47
  222. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -1
  223. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +3 -2
  224. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -1
  225. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +75 -6
  226. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +5 -1
  227. package/dist/prompt/steps/step-ask-question/step-ask-question.js +30 -13
  228. package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -1
  229. package/dist/prompt/steps/step-codegen-planning.d.ts +2 -1
  230. package/dist/prompt/steps/step-codegen-planning.js +2 -1
  231. package/dist/prompt/steps/step-codegen-planning.js.map +1 -1
  232. package/dist/prompt/steps/step-context-optimization.d.ts +2 -1
  233. package/dist/prompt/steps/step-context-optimization.js +13 -13
  234. package/dist/prompt/steps/step-context-optimization.js.map +1 -1
  235. package/dist/prompt/steps/step-ensure-context.d.ts +1 -1
  236. package/dist/prompt/steps/step-ensure-context.js +4 -2
  237. package/dist/prompt/steps/step-ensure-context.js.map +1 -1
  238. package/dist/prompt/steps/step-generate-codegen-summary-prompt.d.ts +2 -0
  239. package/dist/prompt/steps/step-generate-codegen-summary-prompt.js +133 -0
  240. package/dist/prompt/steps/step-generate-codegen-summary-prompt.js.map +1 -0
  241. package/dist/prompt/steps/step-generate-codegen-summary.d.ts +6 -3
  242. package/dist/prompt/steps/step-generate-codegen-summary.js +17 -2
  243. package/dist/prompt/steps/step-generate-codegen-summary.js.map +1 -1
  244. package/dist/prompt/steps/step-generate-image.d.ts +2 -1
  245. package/dist/prompt/steps/step-generate-image.js +4 -2
  246. package/dist/prompt/steps/step-generate-image.js.map +1 -1
  247. package/dist/prompt/steps/step-generate-summary.d.ts +2 -1
  248. package/dist/prompt/steps/step-generate-summary.js +3 -2
  249. package/dist/prompt/steps/step-generate-summary.js.map +1 -1
  250. package/dist/prompt/steps/step-history-update.d.ts +2 -1
  251. package/dist/prompt/steps/step-history-update.js +9 -1
  252. package/dist/prompt/steps/step-history-update.js.map +1 -1
  253. package/dist/prompt/steps/step-process-file-updates.d.ts +7 -3
  254. package/dist/prompt/steps/step-process-file-updates.js +10 -7
  255. package/dist/prompt/steps/step-process-file-updates.js.map +1 -1
  256. package/dist/prompt/steps/step-summarization.d.ts +7 -6
  257. package/dist/prompt/steps/step-summarization.js +79 -48
  258. package/dist/prompt/steps/step-summarization.js.map +1 -1
  259. package/dist/prompt/steps/step-validate-recover.d.ts +4 -2
  260. package/dist/prompt/steps/step-validate-recover.js +8 -6
  261. package/dist/prompt/steps/step-validate-recover.js.map +1 -1
  262. package/dist/prompt/steps/step-verify-patch.d.ts +4 -1
  263. package/dist/prompt/steps/step-verify-patch.js +15 -2
  264. package/dist/prompt/steps/step-verify-patch.js.map +1 -1
  265. package/dist/prompt/steps/steps-types.d.ts +0 -14
  266. package/dist/prompt/steps/steps-types.js.map +1 -1
  267. package/dist/prompt/steps/steps-utils.d.ts +1 -1
  268. package/dist/prompt/systemprompt.d.ts +1 -1
  269. package/dist/prompt/systemprompt.js +40 -11
  270. package/dist/prompt/systemprompt.js.map +1 -1
  271. package/dist/{eval → prompt-debug}/current-prompt-plugin.d.ts +1 -1
  272. package/dist/{eval → prompt-debug}/current-prompt-plugin.js +1 -1
  273. package/dist/prompt-debug/current-prompt-plugin.js.map +1 -0
  274. package/dist/vite-genaicode/vite-genaicode-context.d.ts +31 -0
  275. package/dist/vite-genaicode/vite-genaicode-context.js +120 -0
  276. package/dist/vite-genaicode/vite-genaicode-context.js.map +1 -0
  277. package/dist/vite-genaicode/vite-genaicode-frontend.js +206 -30
  278. package/dist/vite-genaicode/vite-genaicode-frontend.js.map +1 -1
  279. package/dist/vite-genaicode/vite-genaicode-plugin.d.ts +1 -0
  280. package/dist/vite-genaicode/vite-genaicode-plugin.js +22 -9
  281. package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
  282. package/dist/vite-genaicode/vite-genaicode-types.d.ts +26 -0
  283. package/dist/vite-genaicode/vite-genaicode-types.js +11 -0
  284. package/dist/vite-genaicode/vite-genaicode-types.js.map +1 -0
  285. package/package.json +11 -4
  286. package/dist/ai-service/ai-studio.d.ts.map +0 -1
  287. package/dist/ai-service/anthropic.d.ts.map +0 -1
  288. package/dist/ai-service/chat-gpt.d.ts +0 -7
  289. package/dist/ai-service/chat-gpt.d.ts.map +0 -1
  290. package/dist/ai-service/chat-gpt.js +0 -174
  291. package/dist/ai-service/chat-gpt.js.map +0 -1
  292. package/dist/ai-service/common.d.ts.map +0 -1
  293. package/dist/ai-service/common.test.js +0 -86
  294. package/dist/ai-service/common.test.js.map +0 -1
  295. package/dist/ai-service/dall-e.d.ts.map +0 -1
  296. package/dist/ai-service/unescape-function-call.d.ts.map +0 -1
  297. package/dist/ai-service/unescape-function-call.test.d.ts +0 -1
  298. package/dist/ai-service/unescape-function-call.test.js +0 -18
  299. package/dist/ai-service/unescape-function-call.test.js.map +0 -1
  300. package/dist/ai-service/vertex-ai-claude.d.ts.map +0 -1
  301. package/dist/ai-service/vertex-ai-imagen.d.ts.map +0 -1
  302. package/dist/ai-service/vertex-ai.d.ts.map +0 -1
  303. package/dist/cli/cli-options.d.ts.map +0 -1
  304. package/dist/cli/cli-options.test.d.ts +0 -1
  305. package/dist/cli/cli-options.test.js +0 -34
  306. package/dist/cli/cli-options.test.js.map +0 -1
  307. package/dist/cli/cli-params.d.ts.map +0 -1
  308. package/dist/cli/cli-params.test.d.ts +0 -1
  309. package/dist/cli/cli-params.test.js +0 -38
  310. package/dist/cli/cli-params.test.js.map +0 -1
  311. package/dist/cli/service-autodetect.d.ts.map +0 -1
  312. package/dist/cli/service-autodetect.test.d.ts +0 -1
  313. package/dist/cli/service-autodetect.test.js +0 -38
  314. package/dist/cli/service-autodetect.test.js.map +0 -1
  315. package/dist/cli/validate-cli-params.d.ts.map +0 -1
  316. package/dist/cli/validate-cli-params.test.d.ts +0 -1
  317. package/dist/cli/validate-cli-params.test.js +0 -106
  318. package/dist/cli/validate-cli-params.test.js.map +0 -1
  319. package/dist/eval/codegen-summary.test.d.ts +0 -1
  320. package/dist/eval/codegen-summary.test.js +0 -93
  321. package/dist/eval/codegen-summary.test.js.map +0 -1
  322. package/dist/eval/current-prompt-plugin.js.map +0 -1
  323. package/dist/eval/data/current-prompt.d.ts +0 -149
  324. package/dist/eval/data/current-prompt.js +0 -314
  325. package/dist/eval/data/current-prompt.js.map +0 -1
  326. package/dist/eval/data/prompt-assistant-image.d.ts +0 -49
  327. package/dist/eval/data/prompt-assistant-image.js +0 -67
  328. package/dist/eval/data/prompt-assistant-image.js.map +0 -1
  329. package/dist/eval/data/prompt3.d.ts +0 -34
  330. package/dist/eval/data/prompt3.js +0 -71
  331. package/dist/eval/data/prompt3.js.map +0 -1
  332. package/dist/eval/prompt-debug.test.d.ts +0 -1
  333. package/dist/eval/prompt-debug.test.js +0 -93
  334. package/dist/eval/prompt-debug.test.js.map +0 -1
  335. package/dist/eval/prompt2.d.ts +0 -34
  336. package/dist/eval/prompt2.js +0 -125
  337. package/dist/eval/prompt2.js.map +0 -1
  338. package/dist/examples/genaicode_plugins/fake_ai_service.d.ts +0 -3
  339. package/dist/examples/genaicode_plugins/fake_ai_service.js +0 -11
  340. package/dist/examples/genaicode_plugins/fake_ai_service.js.map +0 -1
  341. package/dist/examples/genaicode_plugins/grok_ai_service.d.ts +0 -3
  342. package/dist/examples/genaicode_plugins/grok_ai_service.js +0 -153
  343. package/dist/examples/genaicode_plugins/grok_ai_service.js.map +0 -1
  344. package/dist/examples/genaicode_plugins/nonsense_operation.d.ts +0 -3
  345. package/dist/examples/genaicode_plugins/nonsense_operation.js +0 -23
  346. package/dist/examples/genaicode_plugins/nonsense_operation.js.map +0 -1
  347. package/dist/files/cache-file.d.ts.map +0 -1
  348. package/dist/files/file-utils.d.ts.map +0 -1
  349. package/dist/files/file-utils.test.d.ts +0 -1
  350. package/dist/files/file-utils.test.js +0 -18
  351. package/dist/files/file-utils.test.js.map +0 -1
  352. package/dist/files/find-files.d.ts.map +0 -1
  353. package/dist/files/path-utils.d.ts.map +0 -1
  354. package/dist/files/read-files.d.ts.map +0 -1
  355. package/dist/files/read-files.test.d.ts +0 -1
  356. package/dist/files/read-files.test.js +0 -95
  357. package/dist/files/read-files.test.js.map +0 -1
  358. package/dist/files/search-files.d.ts.map +0 -1
  359. package/dist/files/source-code-tree.d.ts.map +0 -1
  360. package/dist/files/temp-buffer.d.ts.map +0 -1
  361. package/dist/files/update-files.d.ts.map +0 -1
  362. package/dist/images/ensure-alpha.d.ts.map +0 -1
  363. package/dist/images/imgly-remove-background.d.ts.map +0 -1
  364. package/dist/images/resize-image.d.ts.map +0 -1
  365. package/dist/images/split-image.d.ts.map +0 -1
  366. package/dist/index.d.ts.map +0 -1
  367. package/dist/main/codegen-non-interactive.d.ts.map +0 -1
  368. package/dist/main/codegen-types.d.ts.map +0 -1
  369. package/dist/main/codegen-utils.d.ts.map +0 -1
  370. package/dist/main/codegen.ai-services.test.d.ts +0 -3
  371. package/dist/main/codegen.ai-services.test.js +0 -198
  372. package/dist/main/codegen.ai-services.test.js.map +0 -1
  373. package/dist/main/codegen.cli-options.test.d.ts +0 -3
  374. package/dist/main/codegen.cli-options.test.js +0 -171
  375. package/dist/main/codegen.cli-options.test.js.map +0 -1
  376. package/dist/main/codegen.d.ts.map +0 -1
  377. package/dist/main/codegen.image-generation.test.d.ts +0 -3
  378. package/dist/main/codegen.image-generation.test.js +0 -187
  379. package/dist/main/codegen.image-generation.test.js.map +0 -1
  380. package/dist/main/codegen.test-utils.d.ts.map +0 -1
  381. package/dist/main/codegen.test.d.ts +0 -3
  382. package/dist/main/codegen.test.js +0 -307
  383. package/dist/main/codegen.test.js.map +0 -1
  384. package/dist/main/common/content-bus-types.d.ts.map +0 -1
  385. package/dist/main/common/content-bus.d.ts.map +0 -1
  386. package/dist/main/common/cost-collector.d.ts.map +0 -1
  387. package/dist/main/common/user-actions.d.ts.map +0 -1
  388. package/dist/main/config-lib.d.ts.map +0 -1
  389. package/dist/main/config-lib.test.d.ts +0 -1
  390. package/dist/main/config-lib.test.js +0 -64
  391. package/dist/main/config-lib.test.js.map +0 -1
  392. package/dist/main/config.d.ts.map +0 -1
  393. package/dist/main/interactive/codegen-interactive.d.ts.map +0 -1
  394. package/dist/main/interactive/codegen-interactive.test.d.ts +0 -5
  395. package/dist/main/interactive/codegen-interactive.test.js +0 -73
  396. package/dist/main/interactive/codegen-interactive.test.js.map +0 -1
  397. package/dist/main/interactive/codegen-worker.d.ts.map +0 -1
  398. package/dist/main/interactive/common.d.ts.map +0 -1
  399. package/dist/main/interactive/configure.d.ts.map +0 -1
  400. package/dist/main/interactive/error-handling.d.ts.map +0 -1
  401. package/dist/main/interactive/help.d.ts.map +0 -1
  402. package/dist/main/interactive/process-comments.d.ts +0 -2
  403. package/dist/main/interactive/process-comments.js +0 -39
  404. package/dist/main/interactive/process-comments.js.map +0 -1
  405. package/dist/main/interactive/select-ai-service.d.ts.map +0 -1
  406. package/dist/main/interactive/task-file.d.ts.map +0 -1
  407. package/dist/main/interactive/text-prompt.d.ts.map +0 -1
  408. package/dist/main/interactive/user-action-handlers.d.ts.map +0 -1
  409. package/dist/main/interactive/user-interrupt.d.ts.map +0 -1
  410. package/dist/main/plugin-loader.d.ts.map +0 -1
  411. package/dist/main/ui/backend/api-utils.d.ts.map +0 -1
  412. package/dist/main/ui/backend/api.d.ts.map +0 -1
  413. package/dist/main/ui/backend/server.d.ts.map +0 -1
  414. package/dist/main/ui/backend/service.d.ts.map +0 -1
  415. package/dist/main/ui/codegen-ui.d.ts.map +0 -1
  416. package/dist/main/ui/common/api-types.d.ts.map +0 -1
  417. package/dist/main/ui/frontend/assets/index-BAAQr5b1.js +0 -1747
  418. package/dist/main/ui/user-action-handlers.d.ts.map +0 -1
  419. package/dist/operations/create-directory/create-directory-def.d.ts.map +0 -1
  420. package/dist/operations/create-directory/create-directory-executor.d.ts.map +0 -1
  421. package/dist/operations/create-file/create-file-def.d.ts.map +0 -1
  422. package/dist/operations/create-file/create-file-executor.d.ts.map +0 -1
  423. package/dist/operations/delete-file/delete-file-def.d.ts.map +0 -1
  424. package/dist/operations/delete-file/delete-file-executor.d.ts.map +0 -1
  425. package/dist/operations/download-file/download-file-def.d.ts.map +0 -1
  426. package/dist/operations/download-file/download-file-executor.d.ts.map +0 -1
  427. package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts.map +0 -1
  428. package/dist/operations/imgly-remove-background/imgly-remove-background-executor.d.ts.map +0 -1
  429. package/dist/operations/move-file/move-file-def.d.ts.map +0 -1
  430. package/dist/operations/move-file/move-file-executor.d.ts.map +0 -1
  431. package/dist/operations/operations-index.d.ts.map +0 -1
  432. package/dist/operations/patch-file/patch-file-def.d.ts.map +0 -1
  433. package/dist/operations/patch-file/patch-file-executor.d.ts.map +0 -1
  434. package/dist/operations/resize-image/resize-image-def.d.ts.map +0 -1
  435. package/dist/operations/resize-image/resize-image-executor.d.ts.map +0 -1
  436. package/dist/operations/split-image/split-image-def.d.ts.map +0 -1
  437. package/dist/operations/split-image/split-image-executor.d.ts.map +0 -1
  438. package/dist/operations/update-file/update-file-def.d.ts.map +0 -1
  439. package/dist/operations/update-file/update-file-executor.d.ts.map +0 -1
  440. package/dist/project-profiles/detection.d.ts.map +0 -1
  441. package/dist/project-profiles/index.d.ts.map +0 -1
  442. package/dist/project-profiles/profiles/golang.d.ts.map +0 -1
  443. package/dist/project-profiles/profiles/java-maven.d.ts.map +0 -1
  444. package/dist/project-profiles/profiles/javascript-npm.d.ts.map +0 -1
  445. package/dist/project-profiles/profiles/javascript-react.d.ts.map +0 -1
  446. package/dist/project-profiles/profiles/python-django.d.ts.map +0 -1
  447. package/dist/project-profiles/types.d.ts.map +0 -1
  448. package/dist/prompt/ai-service-fallback.d.ts.map +0 -1
  449. package/dist/prompt/function-calling-validate.d.ts.map +0 -1
  450. package/dist/prompt/function-calling.d.ts.map +0 -1
  451. package/dist/prompt/function-defs/ask-question-reflect.d.ts +0 -2
  452. package/dist/prompt/function-defs/ask-question-reflect.js +0 -21
  453. package/dist/prompt/function-defs/ask-question-reflect.js.map +0 -1
  454. package/dist/prompt/function-defs/ask-question.d.ts.map +0 -1
  455. package/dist/prompt/function-defs/codegen-planning.d.ts.map +0 -1
  456. package/dist/prompt/function-defs/codegen-summary.d.ts.map +0 -1
  457. package/dist/prompt/function-defs/create-directory.d.ts +0 -21
  458. package/dist/prompt/function-defs/create-directory.js +0 -22
  459. package/dist/prompt/function-defs/create-directory.js.map +0 -1
  460. package/dist/prompt/function-defs/create-file.d.ts +0 -25
  461. package/dist/prompt/function-defs/create-file.js +0 -26
  462. package/dist/prompt/function-defs/create-file.js.map +0 -1
  463. package/dist/prompt/function-defs/delete-file.d.ts +0 -21
  464. package/dist/prompt/function-defs/delete-file.js +0 -22
  465. package/dist/prompt/function-defs/delete-file.js.map +0 -1
  466. package/dist/prompt/function-defs/download-file.d.ts +0 -25
  467. package/dist/prompt/function-defs/download-file.js +0 -26
  468. package/dist/prompt/function-defs/download-file.js.map +0 -1
  469. package/dist/prompt/function-defs/explanation.d.ts.map +0 -1
  470. package/dist/prompt/function-defs/generate-image.d.ts.map +0 -1
  471. package/dist/prompt/function-defs/get-image-assets.d.ts.map +0 -1
  472. package/dist/prompt/function-defs/get-source-code.d.ts.map +0 -1
  473. package/dist/prompt/function-defs/imgly-remove-background.d.ts +0 -25
  474. package/dist/prompt/function-defs/imgly-remove-background.js +0 -26
  475. package/dist/prompt/function-defs/imgly-remove-background.js.map +0 -1
  476. package/dist/prompt/function-defs/move-file.d.ts +0 -25
  477. package/dist/prompt/function-defs/move-file.js +0 -26
  478. package/dist/prompt/function-defs/move-file.js.map +0 -1
  479. package/dist/prompt/function-defs/optimize-context.d.ts.map +0 -1
  480. package/dist/prompt/function-defs/patch-file.d.ts +0 -25
  481. package/dist/prompt/function-defs/patch-file.js +0 -39
  482. package/dist/prompt/function-defs/patch-file.js.map +0 -1
  483. package/dist/prompt/function-defs/read-history.d.ts.map +0 -1
  484. package/dist/prompt/function-defs/resize-image.d.ts +0 -36
  485. package/dist/prompt/function-defs/resize-image.js +0 -37
  486. package/dist/prompt/function-defs/resize-image.js.map +0 -1
  487. package/dist/prompt/function-defs/set-summaries.d.ts.map +0 -1
  488. package/dist/prompt/function-defs/split-image.d.ts +0 -57
  489. package/dist/prompt/function-defs/split-image.js +0 -46
  490. package/dist/prompt/function-defs/split-image.js.map +0 -1
  491. package/dist/prompt/function-defs/update-file.d.ts +0 -25
  492. package/dist/prompt/function-defs/update-file.js +0 -26
  493. package/dist/prompt/function-defs/update-file.js.map +0 -1
  494. package/dist/prompt/function-defs/update-history.d.ts.map +0 -1
  495. package/dist/prompt/limits.d.ts.map +0 -1
  496. package/dist/prompt/limits.test.d.ts +0 -1
  497. package/dist/prompt/limits.test.js +0 -35
  498. package/dist/prompt/limits.test.js.map +0 -1
  499. package/dist/prompt/prompt-codegen.d.ts.map +0 -1
  500. package/dist/prompt/prompt-codegen.test.d.ts +0 -1
  501. package/dist/prompt/prompt-codegen.test.js +0 -92
  502. package/dist/prompt/prompt-codegen.test.js.map +0 -1
  503. package/dist/prompt/prompt-consts.d.ts +0 -1
  504. package/dist/prompt/prompt-consts.js +0 -2
  505. package/dist/prompt/prompt-consts.js.map +0 -1
  506. package/dist/prompt/prompt-service-ask-question.test.d.ts +0 -4
  507. package/dist/prompt/prompt-service-ask-question.test.js +0 -162
  508. package/dist/prompt/prompt-service-ask-question.test.js.map +0 -1
  509. package/dist/prompt/prompt-service.ai-services.test.d.ts +0 -1
  510. package/dist/prompt/prompt-service.ai-services.test.js +0 -149
  511. package/dist/prompt/prompt-service.ai-services.test.js.map +0 -1
  512. package/dist/prompt/prompt-service.context-optimization.test.d.ts +0 -1
  513. package/dist/prompt/prompt-service.context-optimization.test.js +0 -212
  514. package/dist/prompt/prompt-service.context-optimization.test.js.map +0 -1
  515. package/dist/prompt/prompt-service.d.ts.map +0 -1
  516. package/dist/prompt/prompt-service.image-handling.test.d.ts +0 -1
  517. package/dist/prompt/prompt-service.image-handling.test.js +0 -212
  518. package/dist/prompt/prompt-service.image-handling.test.js.map +0 -1
  519. package/dist/prompt/prompt-service.test-utils.d.ts.map +0 -1
  520. package/dist/prompt/prompt-service.test.d.ts +0 -2
  521. package/dist/prompt/prompt-service.test.js +0 -629
  522. package/dist/prompt/prompt-service.test.js.map +0 -1
  523. package/dist/prompt/prompt-service.validation-recovery.test.d.ts +0 -1
  524. package/dist/prompt/prompt-service.validation-recovery.test.js +0 -263
  525. package/dist/prompt/prompt-service.validation-recovery.test.js.map +0 -1
  526. package/dist/prompt/static-prompts.d.ts.map +0 -1
  527. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
  528. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts.map +0 -1
  529. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +0 -14
  530. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
  531. package/dist/prompt/steps/step-ask-question/handlers/code-generation.d.ts.map +0 -1
  532. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts.map +0 -1
  533. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts.map +0 -1
  534. package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
  535. package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts.map +0 -1
  536. package/dist/prompt/steps/step-ask-question/handlers/default-action.js +0 -15
  537. package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
  538. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.d.ts +0 -2
  539. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js +0 -86
  540. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer-with-image.js.map +0 -1
  541. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
  542. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
  543. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
  544. package/dist/prompt/steps/step-ask-question/handlers/handle-search-code.d.ts.map +0 -1
  545. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts +0 -2
  546. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.d.ts.map +0 -1
  547. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message-with-image.js.map +0 -1
  548. package/dist/prompt/steps/step-ask-question/handlers/handle-send-message.d.ts.map +0 -1
  549. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.d.ts +0 -0
  550. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js +0 -2
  551. package/dist/prompt/steps/step-ask-question/handlers/handler-utils.js.map +0 -1
  552. package/dist/prompt/steps/step-ask-question/handlers/lint.d.ts.map +0 -1
  553. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts.map +0 -1
  554. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts.map +0 -1
  555. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts.map +0 -1
  556. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
  557. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
  558. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
  559. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  560. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
  561. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
  562. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
  563. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -92
  564. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
  565. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts.map +0 -1
  566. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts.map +0 -1
  567. package/dist/prompt/steps/step-ask-question-handlers.d.ts +0 -10
  568. package/dist/prompt/steps/step-ask-question-handlers.js +0 -257
  569. package/dist/prompt/steps/step-ask-question-handlers.js.map +0 -1
  570. package/dist/prompt/steps/step-ask-question-reflect.d.ts +0 -4
  571. package/dist/prompt/steps/step-ask-question-reflect.js +0 -48
  572. package/dist/prompt/steps/step-ask-question-reflect.js.map +0 -1
  573. package/dist/prompt/steps/step-ask-question-types.d.ts +0 -55
  574. package/dist/prompt/steps/step-ask-question-types.js +0 -2
  575. package/dist/prompt/steps/step-ask-question-types.js.map +0 -1
  576. package/dist/prompt/steps/step-ask-question.d.ts +0 -6
  577. package/dist/prompt/steps/step-ask-question.js +0 -80
  578. package/dist/prompt/steps/step-ask-question.js.map +0 -1
  579. package/dist/prompt/steps/step-codegen-planning.d.ts.map +0 -1
  580. package/dist/prompt/steps/step-codegen-summary.d.ts +0 -7
  581. package/dist/prompt/steps/step-codegen-summary.d.ts.map +0 -1
  582. package/dist/prompt/steps/step-codegen-summary.js +0 -106
  583. package/dist/prompt/steps/step-codegen-summary.js.map +0 -1
  584. package/dist/prompt/steps/step-codegen-summary.test.d.ts +0 -1
  585. package/dist/prompt/steps/step-codegen-summary.test.js +0 -136
  586. package/dist/prompt/steps/step-codegen-summary.test.js.map +0 -1
  587. package/dist/prompt/steps/step-context-optimization.d.ts.map +0 -1
  588. package/dist/prompt/steps/step-context-optimization.test.d.ts +0 -2
  589. package/dist/prompt/steps/step-context-optimization.test.js +0 -475
  590. package/dist/prompt/steps/step-context-optimization.test.js.map +0 -1
  591. package/dist/prompt/steps/step-ensure-context.d.ts.map +0 -1
  592. package/dist/prompt/steps/step-ensure-context.test.d.ts +0 -1
  593. package/dist/prompt/steps/step-ensure-context.test.js +0 -326
  594. package/dist/prompt/steps/step-ensure-context.test.js.map +0 -1
  595. package/dist/prompt/steps/step-generate-image.d.ts.map +0 -1
  596. package/dist/prompt/steps/step-generate-summary.d.ts.map +0 -1
  597. package/dist/prompt/steps/step-history-update.d.ts.map +0 -1
  598. package/dist/prompt/steps/step-summarization.d.ts.map +0 -1
  599. package/dist/prompt/steps/step-validate-recover.d.ts.map +0 -1
  600. package/dist/prompt/steps/step-verify-patch.d.ts.map +0 -1
  601. package/dist/prompt/steps/steps-types.d.ts.map +0 -1
  602. package/dist/prompt/steps/steps-utils.d.ts.map +0 -1
  603. package/dist/prompt/systemprompt.d.ts.map +0 -1
  604. package/dist/prompt/systemprompt.test.d.ts +0 -3
  605. package/dist/prompt/systemprompt.test.js +0 -42
  606. package/dist/prompt/systemprompt.test.js.map +0 -1
  607. package/dist/prompt/token-estimator.d.ts.map +0 -1
  608. package/dist/src/ai-service/ai-studio.d.ts +0 -6
  609. package/dist/src/ai-service/ai-studio.js +0 -190
  610. package/dist/src/ai-service/ai-studio.js.map +0 -1
  611. package/dist/src/ai-service/anthropic.d.ts +0 -6
  612. package/dist/src/ai-service/anthropic.js +0 -150
  613. package/dist/src/ai-service/anthropic.js.map +0 -1
  614. package/dist/src/ai-service/chat-gpt.d.ts +0 -5
  615. package/dist/src/ai-service/chat-gpt.js +0 -146
  616. package/dist/src/ai-service/chat-gpt.js.map +0 -1
  617. package/dist/src/ai-service/common.js +0 -38
  618. package/dist/src/ai-service/common.js.map +0 -1
  619. package/dist/src/ai-service/common.test.d.ts +0 -1
  620. package/dist/src/ai-service/common.test.js +0 -86
  621. package/dist/src/ai-service/common.test.js.map +0 -1
  622. package/dist/src/ai-service/dall-e.d.ts +0 -14
  623. package/dist/src/ai-service/dall-e.js +0 -50
  624. package/dist/src/ai-service/dall-e.js.map +0 -1
  625. package/dist/src/ai-service/unescape-function-call.d.ts +0 -7
  626. package/dist/src/ai-service/unescape-function-call.js +0 -59
  627. package/dist/src/ai-service/unescape-function-call.js.map +0 -1
  628. package/dist/src/ai-service/unescape-function-call.test.d.ts +0 -1
  629. package/dist/src/ai-service/unescape-function-call.test.js +0 -18
  630. package/dist/src/ai-service/unescape-function-call.test.js.map +0 -1
  631. package/dist/src/ai-service/vertex-ai-claude.d.ts +0 -5
  632. package/dist/src/ai-service/vertex-ai-claude.js +0 -104
  633. package/dist/src/ai-service/vertex-ai-claude.js.map +0 -1
  634. package/dist/src/ai-service/vertex-ai-imagen.d.ts +0 -14
  635. package/dist/src/ai-service/vertex-ai-imagen.js +0 -77
  636. package/dist/src/ai-service/vertex-ai-imagen.js.map +0 -1
  637. package/dist/src/ai-service/vertex-ai.d.ts +0 -6
  638. package/dist/src/ai-service/vertex-ai.js +0 -202
  639. package/dist/src/ai-service/vertex-ai.js.map +0 -1
  640. package/dist/src/cli/cli-options.d.ts +0 -10
  641. package/dist/src/cli/cli-options.js +0 -132
  642. package/dist/src/cli/cli-options.js.map +0 -1
  643. package/dist/src/cli/cli-options.test.d.ts +0 -1
  644. package/dist/src/cli/cli-options.test.js +0 -34
  645. package/dist/src/cli/cli-options.test.js.map +0 -1
  646. package/dist/src/cli/cli-params.d.ts +0 -32
  647. package/dist/src/cli/cli-params.js +0 -106
  648. package/dist/src/cli/cli-params.js.map +0 -1
  649. package/dist/src/cli/cli-params.test.d.ts +0 -1
  650. package/dist/src/cli/cli-params.test.js +0 -38
  651. package/dist/src/cli/cli-params.test.js.map +0 -1
  652. package/dist/src/cli/service-autodetect.d.ts +0 -2
  653. package/dist/src/cli/service-autodetect.js +0 -17
  654. package/dist/src/cli/service-autodetect.js.map +0 -1
  655. package/dist/src/cli/service-autodetect.test.d.ts +0 -1
  656. package/dist/src/cli/service-autodetect.test.js +0 -38
  657. package/dist/src/cli/service-autodetect.test.js.map +0 -1
  658. package/dist/src/cli/validate-cli-params.d.ts +0 -18
  659. package/dist/src/cli/validate-cli-params.js +0 -145
  660. package/dist/src/cli/validate-cli-params.js.map +0 -1
  661. package/dist/src/cli/validate-cli-params.test.d.ts +0 -1
  662. package/dist/src/cli/validate-cli-params.test.js +0 -106
  663. package/dist/src/cli/validate-cli-params.test.js.map +0 -1
  664. package/dist/src/files/cache-file.d.ts +0 -3
  665. package/dist/src/files/cache-file.js +0 -36
  666. package/dist/src/files/cache-file.js.map +0 -1
  667. package/dist/src/files/file-utils.d.ts +0 -2
  668. package/dist/src/files/file-utils.js +0 -7
  669. package/dist/src/files/file-utils.js.map +0 -1
  670. package/dist/src/files/file-utils.test.d.ts +0 -1
  671. package/dist/src/files/file-utils.test.js +0 -18
  672. package/dist/src/files/file-utils.test.js.map +0 -1
  673. package/dist/src/files/find-files.d.ts +0 -9
  674. package/dist/src/files/find-files.js +0 -81
  675. package/dist/src/files/find-files.js.map +0 -1
  676. package/dist/src/files/path-utils.d.ts +0 -1
  677. package/dist/src/files/path-utils.js +0 -12
  678. package/dist/src/files/path-utils.js.map +0 -1
  679. package/dist/src/files/read-files.d.ts +0 -21
  680. package/dist/src/files/read-files.js +0 -68
  681. package/dist/src/files/read-files.js.map +0 -1
  682. package/dist/src/files/read-files.test.d.ts +0 -1
  683. package/dist/src/files/read-files.test.js +0 -89
  684. package/dist/src/files/read-files.test.js.map +0 -1
  685. package/dist/src/files/temp-buffer.d.ts +0 -2
  686. package/dist/src/files/temp-buffer.js +0 -12
  687. package/dist/src/files/temp-buffer.js.map +0 -1
  688. package/dist/src/files/update-files.d.ts +0 -6
  689. package/dist/src/files/update-files.js +0 -19
  690. package/dist/src/files/update-files.js.map +0 -1
  691. package/dist/src/images/ensure-alpha.d.ts +0 -1
  692. package/dist/src/images/ensure-alpha.js +0 -5
  693. package/dist/src/images/ensure-alpha.js.map +0 -1
  694. package/dist/src/images/imgly-remove-background.d.ts +0 -2
  695. package/dist/src/images/imgly-remove-background.js +0 -21
  696. package/dist/src/images/imgly-remove-background.js.map +0 -1
  697. package/dist/src/images/resize-image.d.ts +0 -19
  698. package/dist/src/images/resize-image.js +0 -22
  699. package/dist/src/images/resize-image.js.map +0 -1
  700. package/dist/src/images/split-image.d.ts +0 -18
  701. package/dist/src/images/split-image.js +0 -25
  702. package/dist/src/images/split-image.js.map +0 -1
  703. package/dist/src/index.d.ts +0 -3
  704. package/dist/src/index.js +0 -3
  705. package/dist/src/index.js.map +0 -1
  706. package/dist/src/main/codegen-types.d.ts +0 -58
  707. package/dist/src/main/codegen-types.js +0 -2
  708. package/dist/src/main/codegen-types.js.map +0 -1
  709. package/dist/src/main/codegen-utils.d.ts +0 -3
  710. package/dist/src/main/codegen-utils.js +0 -18
  711. package/dist/src/main/codegen-utils.js.map +0 -1
  712. package/dist/src/main/codegen.d.ts +0 -4
  713. package/dist/src/main/codegen.js +0 -201
  714. package/dist/src/main/codegen.js.map +0 -1
  715. package/dist/src/main/codegen.test.d.ts +0 -3
  716. package/dist/src/main/codegen.test.js +0 -288
  717. package/dist/src/main/codegen.test.js.map +0 -1
  718. package/dist/src/main/common/content-bus-types.d.ts +0 -21
  719. package/dist/src/main/common/content-bus-types.js +0 -11
  720. package/dist/src/main/common/content-bus-types.js.map +0 -1
  721. package/dist/src/main/common/content-bus.d.ts +0 -10
  722. package/dist/src/main/common/content-bus.js +0 -39
  723. package/dist/src/main/common/content-bus.js.map +0 -1
  724. package/dist/src/main/common/cost-collector.d.ts +0 -11
  725. package/dist/src/main/common/cost-collector.js +0 -90
  726. package/dist/src/main/common/cost-collector.js.map +0 -1
  727. package/dist/src/main/common/user-actions.d.ts +0 -19
  728. package/dist/src/main/common/user-actions.js +0 -30
  729. package/dist/src/main/common/user-actions.js.map +0 -1
  730. package/dist/src/main/config-lib.d.ts +0 -36
  731. package/dist/src/main/config-lib.js +0 -51
  732. package/dist/src/main/config-lib.js.map +0 -1
  733. package/dist/src/main/config-lib.test.d.ts +0 -1
  734. package/dist/src/main/config-lib.test.js +0 -64
  735. package/dist/src/main/config-lib.test.js.map +0 -1
  736. package/dist/src/main/config.d.ts +0 -7
  737. package/dist/src/main/config.js +0 -51
  738. package/dist/src/main/config.js.map +0 -1
  739. package/dist/src/main/interactive/codegen-interactive.d.ts +0 -2
  740. package/dist/src/main/interactive/codegen-interactive.js +0 -61
  741. package/dist/src/main/interactive/codegen-interactive.js.map +0 -1
  742. package/dist/src/main/interactive/codegen-interactive.test.d.ts +0 -5
  743. package/dist/src/main/interactive/codegen-interactive.test.js +0 -79
  744. package/dist/src/main/interactive/codegen-interactive.test.js.map +0 -1
  745. package/dist/src/main/interactive/codegen-worker.d.ts +0 -3
  746. package/dist/src/main/interactive/codegen-worker.js +0 -54
  747. package/dist/src/main/interactive/codegen-worker.js.map +0 -1
  748. package/dist/src/main/interactive/common.d.ts +0 -5
  749. package/dist/src/main/interactive/common.js +0 -51
  750. package/dist/src/main/interactive/common.js.map +0 -1
  751. package/dist/src/main/interactive/configure.d.ts +0 -2
  752. package/dist/src/main/interactive/configure.js +0 -99
  753. package/dist/src/main/interactive/configure.js.map +0 -1
  754. package/dist/src/main/interactive/error-handling.d.ts +0 -1
  755. package/dist/src/main/interactive/error-handling.js +0 -43
  756. package/dist/src/main/interactive/error-handling.js.map +0 -1
  757. package/dist/src/main/interactive/help.d.ts +0 -1
  758. package/dist/src/main/interactive/help.js +0 -22
  759. package/dist/src/main/interactive/help.js.map +0 -1
  760. package/dist/src/main/interactive/process-comments.d.ts +0 -2
  761. package/dist/src/main/interactive/process-comments.js +0 -39
  762. package/dist/src/main/interactive/process-comments.js.map +0 -1
  763. package/dist/src/main/interactive/select-ai-service.d.ts +0 -2
  764. package/dist/src/main/interactive/select-ai-service.js +0 -27
  765. package/dist/src/main/interactive/select-ai-service.js.map +0 -1
  766. package/dist/src/main/interactive/task-file.d.ts +0 -2
  767. package/dist/src/main/interactive/task-file.js +0 -35
  768. package/dist/src/main/interactive/task-file.js.map +0 -1
  769. package/dist/src/main/interactive/text-prompt.d.ts +0 -2
  770. package/dist/src/main/interactive/text-prompt.js +0 -18
  771. package/dist/src/main/interactive/text-prompt.js.map +0 -1
  772. package/dist/src/main/interactive/user-action-handlers.d.ts +0 -1
  773. package/dist/src/main/interactive/user-action-handlers.js +0 -13
  774. package/dist/src/main/interactive/user-action-handlers.js.map +0 -1
  775. package/dist/src/main/interactive/user-interrupt.d.ts +0 -1
  776. package/dist/src/main/interactive/user-interrupt.js +0 -36
  777. package/dist/src/main/interactive/user-interrupt.js.map +0 -1
  778. package/dist/src/main/plugin-loader.d.ts +0 -6
  779. package/dist/src/main/plugin-loader.js +0 -40
  780. package/dist/src/main/plugin-loader.js.map +0 -1
  781. package/dist/src/main/ui/backend/api-utils.d.ts +0 -2
  782. package/dist/src/main/ui/backend/api-utils.js +0 -18
  783. package/dist/src/main/ui/backend/api-utils.js.map +0 -1
  784. package/dist/src/main/ui/backend/api.d.ts +0 -2
  785. package/dist/src/main/ui/backend/api.js +0 -210
  786. package/dist/src/main/ui/backend/api.js.map +0 -1
  787. package/dist/src/main/ui/backend/server.d.ts +0 -7
  788. package/dist/src/main/ui/backend/server.js +0 -83
  789. package/dist/src/main/ui/backend/server.js.map +0 -1
  790. package/dist/src/main/ui/backend/service.d.ts +0 -44
  791. package/dist/src/main/ui/backend/service.js +0 -171
  792. package/dist/src/main/ui/backend/service.js.map +0 -1
  793. package/dist/src/main/ui/codegen-ui.d.ts +0 -2
  794. package/dist/src/main/ui/codegen-ui.js +0 -13
  795. package/dist/src/main/ui/codegen-ui.js.map +0 -1
  796. package/dist/src/main/ui/common/api-types.d.ts +0 -20
  797. package/dist/src/main/ui/common/api-types.js +0 -2
  798. package/dist/src/main/ui/common/api-types.js.map +0 -1
  799. package/dist/src/main/ui/user-action-handlers.d.ts +0 -2
  800. package/dist/src/main/ui/user-action-handlers.js +0 -14
  801. package/dist/src/main/ui/user-action-handlers.js.map +0 -1
  802. package/dist/src/operations/create-directory/create-directory-def.d.ts +0 -9
  803. package/dist/src/operations/create-directory/create-directory-def.js +0 -22
  804. package/dist/src/operations/create-directory/create-directory-def.js.map +0 -1
  805. package/dist/src/operations/create-directory/create-directory-executor.d.ts +0 -6
  806. package/dist/src/operations/create-directory/create-directory-executor.js +0 -22
  807. package/dist/src/operations/create-directory/create-directory-executor.js.map +0 -1
  808. package/dist/src/operations/create-file/create-file-def.d.ts +0 -10
  809. package/dist/src/operations/create-file/create-file-def.js +0 -26
  810. package/dist/src/operations/create-file/create-file-def.js.map +0 -1
  811. package/dist/src/operations/create-file/create-file-executor.d.ts +0 -6
  812. package/dist/src/operations/create-file/create-file-executor.js +0 -27
  813. package/dist/src/operations/create-file/create-file-executor.js.map +0 -1
  814. package/dist/src/operations/delete-file/delete-file-def.d.ts +0 -9
  815. package/dist/src/operations/delete-file/delete-file-def.js +0 -22
  816. package/dist/src/operations/delete-file/delete-file-def.js.map +0 -1
  817. package/dist/src/operations/delete-file/delete-file-executor.d.ts +0 -6
  818. package/dist/src/operations/delete-file/delete-file-executor.js +0 -23
  819. package/dist/src/operations/delete-file/delete-file-executor.js.map +0 -1
  820. package/dist/src/operations/download-file/download-file-def.d.ts +0 -10
  821. package/dist/src/operations/download-file/download-file-def.js +0 -26
  822. package/dist/src/operations/download-file/download-file-def.js.map +0 -1
  823. package/dist/src/operations/download-file/download-file-executor.d.ts +0 -6
  824. package/dist/src/operations/download-file/download-file-executor.js +0 -44
  825. package/dist/src/operations/download-file/download-file-executor.js.map +0 -1
  826. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.d.ts +0 -10
  827. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js +0 -26
  828. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js.map +0 -1
  829. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.d.ts +0 -6
  830. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js +0 -40
  831. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js.map +0 -1
  832. package/dist/src/operations/move-file/move-file-def.d.ts +0 -10
  833. package/dist/src/operations/move-file/move-file-def.js +0 -26
  834. package/dist/src/operations/move-file/move-file-def.js.map +0 -1
  835. package/dist/src/operations/move-file/move-file-executor.d.ts +0 -6
  836. package/dist/src/operations/move-file/move-file-executor.js +0 -29
  837. package/dist/src/operations/move-file/move-file-executor.js.map +0 -1
  838. package/dist/src/operations/operations-index.d.ts +0 -3
  839. package/dist/src/operations/operations-index.js +0 -33
  840. package/dist/src/operations/operations-index.js.map +0 -1
  841. package/dist/src/operations/patch-file/patch-file-def.d.ts +0 -10
  842. package/dist/src/operations/patch-file/patch-file-def.js +0 -39
  843. package/dist/src/operations/patch-file/patch-file-def.js.map +0 -1
  844. package/dist/src/operations/patch-file/patch-file-executor.d.ts +0 -5
  845. package/dist/src/operations/patch-file/patch-file-executor.js +0 -26
  846. package/dist/src/operations/patch-file/patch-file-executor.js.map +0 -1
  847. package/dist/src/operations/resize-image/resize-image-def.d.ts +0 -13
  848. package/dist/src/operations/resize-image/resize-image-def.js +0 -37
  849. package/dist/src/operations/resize-image/resize-image-def.js.map +0 -1
  850. package/dist/src/operations/resize-image/resize-image-executor.d.ts +0 -5
  851. package/dist/src/operations/resize-image/resize-image-executor.js +0 -30
  852. package/dist/src/operations/resize-image/resize-image-executor.js.map +0 -1
  853. package/dist/src/operations/split-image/split-image-def.d.ts +0 -18
  854. package/dist/src/operations/split-image/split-image-def.js +0 -46
  855. package/dist/src/operations/split-image/split-image-def.js.map +0 -1
  856. package/dist/src/operations/split-image/split-image-executor.d.ts +0 -6
  857. package/dist/src/operations/split-image/split-image-executor.js +0 -51
  858. package/dist/src/operations/split-image/split-image-executor.js.map +0 -1
  859. package/dist/src/operations/update-file/update-file-def.d.ts +0 -10
  860. package/dist/src/operations/update-file/update-file-def.js +0 -26
  861. package/dist/src/operations/update-file/update-file-def.js.map +0 -1
  862. package/dist/src/operations/update-file/update-file-executor.d.ts +0 -5
  863. package/dist/src/operations/update-file/update-file-executor.js +0 -22
  864. package/dist/src/operations/update-file/update-file-executor.js.map +0 -1
  865. package/dist/src/prompt/ai-service-fallback.d.ts +0 -3
  866. package/dist/src/prompt/ai-service-fallback.js +0 -84
  867. package/dist/src/prompt/ai-service-fallback.js.map +0 -1
  868. package/dist/src/prompt/function-calling-validate.d.ts +0 -3
  869. package/dist/src/prompt/function-calling-validate.js +0 -99
  870. package/dist/src/prompt/function-calling-validate.js.map +0 -1
  871. package/dist/src/prompt/function-calling.d.ts +0 -5
  872. package/dist/src/prompt/function-calling.js +0 -43
  873. package/dist/src/prompt/function-calling.js.map +0 -1
  874. package/dist/src/prompt/function-defs/ask-question-reflect.d.ts +0 -2
  875. package/dist/src/prompt/function-defs/ask-question-reflect.js +0 -21
  876. package/dist/src/prompt/function-defs/ask-question-reflect.js.map +0 -1
  877. package/dist/src/prompt/function-defs/ask-question.d.ts +0 -8
  878. package/dist/src/prompt/function-defs/ask-question.js +0 -100
  879. package/dist/src/prompt/function-defs/ask-question.js.map +0 -1
  880. package/dist/src/prompt/function-defs/codegen-summary.d.ts +0 -5
  881. package/dist/src/prompt/function-defs/codegen-summary.js +0 -82
  882. package/dist/src/prompt/function-defs/codegen-summary.js.map +0 -1
  883. package/dist/src/prompt/function-defs/explanation.d.ts +0 -5
  884. package/dist/src/prompt/function-defs/explanation.js +0 -18
  885. package/dist/src/prompt/function-defs/explanation.js.map +0 -1
  886. package/dist/src/prompt/function-defs/generate-image.d.ts +0 -5
  887. package/dist/src/prompt/function-defs/generate-image.js +0 -42
  888. package/dist/src/prompt/function-defs/generate-image.js.map +0 -1
  889. package/dist/src/prompt/function-defs/get-image-assets.d.ts +0 -5
  890. package/dist/src/prompt/function-defs/get-image-assets.js +0 -21
  891. package/dist/src/prompt/function-defs/get-image-assets.js.map +0 -1
  892. package/dist/src/prompt/function-defs/get-source-code.d.ts +0 -5
  893. package/dist/src/prompt/function-defs/get-source-code.js +0 -22
  894. package/dist/src/prompt/function-defs/get-source-code.js.map +0 -1
  895. package/dist/src/prompt/function-defs/optimize-context.d.ts +0 -5
  896. package/dist/src/prompt/function-defs/optimize-context.js +0 -47
  897. package/dist/src/prompt/function-defs/optimize-context.js.map +0 -1
  898. package/dist/src/prompt/function-defs/read-history.d.ts +0 -2
  899. package/dist/src/prompt/function-defs/read-history.js +0 -14
  900. package/dist/src/prompt/function-defs/read-history.js.map +0 -1
  901. package/dist/src/prompt/function-defs/set-summaries.d.ts +0 -5
  902. package/dist/src/prompt/function-defs/set-summaries.js +0 -32
  903. package/dist/src/prompt/function-defs/set-summaries.js.map +0 -1
  904. package/dist/src/prompt/function-defs/update-history.d.ts +0 -5
  905. package/dist/src/prompt/function-defs/update-history.js +0 -22
  906. package/dist/src/prompt/function-defs/update-history.js.map +0 -1
  907. package/dist/src/prompt/limits.d.ts +0 -3
  908. package/dist/src/prompt/limits.js +0 -21
  909. package/dist/src/prompt/limits.js.map +0 -1
  910. package/dist/src/prompt/limits.test.d.ts +0 -1
  911. package/dist/src/prompt/limits.test.js +0 -35
  912. package/dist/src/prompt/limits.test.js.map +0 -1
  913. package/dist/src/prompt/prompt-codegen.d.ts +0 -9
  914. package/dist/src/prompt/prompt-codegen.js +0 -117
  915. package/dist/src/prompt/prompt-codegen.js.map +0 -1
  916. package/dist/src/prompt/prompt-codegen.test.d.ts +0 -1
  917. package/dist/src/prompt/prompt-codegen.test.js +0 -98
  918. package/dist/src/prompt/prompt-codegen.test.js.map +0 -1
  919. package/dist/src/prompt/prompt-consts.d.ts +0 -1
  920. package/dist/src/prompt/prompt-consts.js +0 -2
  921. package/dist/src/prompt/prompt-consts.js.map +0 -1
  922. package/dist/src/prompt/prompt-service-ask-question.test.d.ts +0 -4
  923. package/dist/src/prompt/prompt-service-ask-question.test.js +0 -215
  924. package/dist/src/prompt/prompt-service-ask-question.test.js.map +0 -1
  925. package/dist/src/prompt/prompt-service.d.ts +0 -5
  926. package/dist/src/prompt/prompt-service.js +0 -214
  927. package/dist/src/prompt/prompt-service.js.map +0 -1
  928. package/dist/src/prompt/prompt-service.test.d.ts +0 -2
  929. package/dist/src/prompt/prompt-service.test.js +0 -553
  930. package/dist/src/prompt/prompt-service.test.js.map +0 -1
  931. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +0 -2
  932. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +0 -16
  933. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +0 -1
  934. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +0 -2
  935. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +0 -37
  936. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +0 -1
  937. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +0 -2
  938. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js +0 -36
  939. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js.map +0 -1
  940. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.d.ts +0 -2
  941. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js +0 -18
  942. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js.map +0 -1
  943. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +0 -2
  944. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js +0 -20
  945. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +0 -1
  946. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +0 -2
  947. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +0 -43
  948. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +0 -1
  949. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +0 -2
  950. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js +0 -49
  951. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js.map +0 -1
  952. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +0 -2
  953. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js +0 -46
  954. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js.map +0 -1
  955. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +0 -2
  956. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js +0 -16
  957. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +0 -1
  958. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  959. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js +0 -2
  960. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +0 -1
  961. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +0 -4
  962. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js +0 -91
  963. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +0 -1
  964. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.d.ts +0 -55
  965. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js +0 -2
  966. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js.map +0 -1
  967. package/dist/src/prompt/steps/step-ask-question/step-ask-question.d.ts +0 -6
  968. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js +0 -88
  969. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js.map +0 -1
  970. package/dist/src/prompt/steps/step-context-optimization.d.ts +0 -4
  971. package/dist/src/prompt/steps/step-context-optimization.js +0 -200
  972. package/dist/src/prompt/steps/step-context-optimization.js.map +0 -1
  973. package/dist/src/prompt/steps/step-generate-image.d.ts +0 -2
  974. package/dist/src/prompt/steps/step-generate-image.js +0 -29
  975. package/dist/src/prompt/steps/step-generate-image.js.map +0 -1
  976. package/dist/src/prompt/steps/step-generate-summary.d.ts +0 -3
  977. package/dist/src/prompt/steps/step-generate-summary.js +0 -41
  978. package/dist/src/prompt/steps/step-generate-summary.js.map +0 -1
  979. package/dist/src/prompt/steps/step-history-update.d.ts +0 -5
  980. package/dist/src/prompt/steps/step-history-update.js +0 -54
  981. package/dist/src/prompt/steps/step-history-update.js.map +0 -1
  982. package/dist/src/prompt/steps/step-summarization.d.ts +0 -8
  983. package/dist/src/prompt/steps/step-summarization.js +0 -75
  984. package/dist/src/prompt/steps/step-summarization.js.map +0 -1
  985. package/dist/src/prompt/steps/step-validate-recover.d.ts +0 -2
  986. package/dist/src/prompt/steps/step-validate-recover.js +0 -51
  987. package/dist/src/prompt/steps/step-validate-recover.js.map +0 -1
  988. package/dist/src/prompt/steps/step-verify-patch.d.ts +0 -6
  989. package/dist/src/prompt/steps/step-verify-patch.js +0 -34
  990. package/dist/src/prompt/steps/step-verify-patch.js.map +0 -1
  991. package/dist/src/prompt/steps/steps-types.d.ts +0 -16
  992. package/dist/src/prompt/steps/steps-types.js +0 -6
  993. package/dist/src/prompt/steps/steps-types.js.map +0 -1
  994. package/dist/src/prompt/steps/steps-utils.d.ts +0 -7
  995. package/dist/src/prompt/steps/steps-utils.js +0 -11
  996. package/dist/src/prompt/steps/steps-utils.js.map +0 -1
  997. package/dist/src/prompt/systemprompt.d.ts +0 -3
  998. package/dist/src/prompt/systemprompt.js +0 -209
  999. package/dist/src/prompt/systemprompt.js.map +0 -1
  1000. package/dist/src/prompt/systemprompt.test.d.ts +0 -3
  1001. package/dist/src/prompt/systemprompt.test.js +0 -43
  1002. package/dist/src/prompt/systemprompt.test.js.map +0 -1
  1003. package/dist/src/prompt/token-estimator.d.ts +0 -8
  1004. package/dist/src/prompt/token-estimator.js +0 -31
  1005. package/dist/src/prompt/token-estimator.js.map +0 -1
  1006. package/dist/src/vite-genaicode/vite-genaicode-frontend.d.ts +0 -1
  1007. package/dist/src/vite-genaicode/vite-genaicode-frontend.js +0 -142
  1008. package/dist/src/vite-genaicode/vite-genaicode-frontend.js.map +0 -1
  1009. package/dist/src/vite-genaicode/vite-genaicode-plugin.d.ts +0 -7
  1010. package/dist/src/vite-genaicode/vite-genaicode-plugin.js +0 -40
  1011. package/dist/src/vite-genaicode/vite-genaicode-plugin.js.map +0 -1
  1012. package/dist/vite-genaicode/vite-genaicode-frontend.d.ts.map +0 -1
  1013. package/dist/vite-genaicode/vite-genaicode-plugin.d.ts.map +0 -1
  1014. /package/dist/{ai-service/common.test.d.ts → main/ui/backend/endpoints/context-endpoint.d.ts} +0 -0
@@ -1,314 +0,0 @@
1
- export const DEBUG_CURRENT_PROMPT = [
2
- {
3
- "type": "systemPrompt",
4
- "systemPrompt": "## Who are you?\n\nYou are GenAIcode, a code generation assistant tasked with helping me implement my ideas into my application's source code.\nYou should parse my application source code and then suggest changes using appropriate tools.\nPlease limit any changes to the root directory of my application, which is `/Users/gtanczyk/src/codegen`.\n\n## Important Guidelines\n\n- **Use Absolute Paths**: Always use absolute file paths exactly as provided.\n- **Return Working Code**: Aim to return fully functional code.\n- **Avoid Incomplete Code Snippets**: Do not include commented-out fragments like `// ... (keep other existing functions)`.\n- **Handle Large Files Appropriately**: For large files, prefer to use the `patchFile` function.\n- **Suggest File Splitting When Relevant**: Suggest splitting large files if it improves maintainability.\n- **Verify Permissions**: Ensure you have the necessary permissions before proceeding.\n- **Error Handling**: If instructions are unclear, consider failing the task with an explanation.\n- **Produce Necessary Code Only**: Do not generate unnecessary code.\n- **Request Context When Needed**: Ask for sufficient context paths in the code generation summary.\n- **Perform Dependency Analysis**: Always analyze the task thoroughly to identify all files that need to be updated, including dependencies and related modules.\n- **Comprehensive File Updates**: Ensure that all relevant files are included in the `fileUpdates` list when proposing changes.\n- **Perform Thorough Analysis**: Before generating code, always perform a comprehensive analysis of the task, identifying all affected files and dependencies.\n- **Communicate Planned Changes**: Summarize the planned changes and list all files to be updated. Seek user confirmation before proceeding.\n- **Consider Dependencies**: Include any dependent files that might require updates to ensure the codebase remains consistent.\n- **Avoid Unnecessary Permission Requests**: Do not request permissions that you already have.\n\n## Your permissions\n\n- You are allowed to modify files.\n- You are allowed to create new files.\n- You are allowed to delete files; in such cases, add an empty string as content.\n- You are allowed to create new directories.\n- You are allowed to move files.\n- Do not analyze image assets.\n- You are allowed to generate images.\n## Asking Questions And Conversing\nYou have the ability to have a conversation with me to clarify requirements, seek permissions, or request additional context.\nUse this feature wisely to gather crucial information that would help you better understand the task or provide more accurate code generation.\n\nTo have conversation with me use the `askQuestion` function. This function allows you to:\n\n- **Express Your Thoughts**: Inform me about your considerations or concerns regarding the task.\n- **Share Analysis**: Provide insights or analysis based on the task requirements.\n- **Seek Clarification**: Ask questions or provide suggestions to ensure you fully understand the requirements.\n- **Request File Access**: If certain files are important but haven't been provided, request access to their content.\n- **Request Permissions**: If you need permissions for operations that were initially restricted, you may request them.\n- **Generate an image**: If you want to express your thoughts through an image, you can request image generation.\n\n### Efficient File Content Requests\n\nYou can request the content of legitimate files within the project without interrupting the user. This allows you to gather more context when needed.\n\n- **Judicious Use**: Only request files directly relevant to the task.\n- **Relevance**: Consider if the file content is truly necessary.\n- **Large Files**: Be cautious when requesting large files.\n- **Dependencies**: Trace through file dependencies when necessary.\n- **Privacy and Security**: Be mindful of sensitive information.\n- **Iterative Requests**: Anticipate your needs to minimize the number of requests.\n\n# Typical Conversation Flow \n\nIt is ** VERY IMPORTANT ** to follow the conversation flow to ensure a smooth and efficient code generation process. Here is a typical conversation flow:\n\n1. I provide you with source code and context.\n2. Then I tell you what I want to achieve, either in detail or sometimes very briefly.\n3. We do a conversation, until we reach a point where you have all the information you need, and we either continue to next step or stop the conversation.\n4. You propose to start code generation (actionType: confirmCodeGeneration)\n5. I confirm that you can proceed (or reject and we go back to step 3)\n6. You generate the code changes summary\n7. Then you generate code change for each file\n8. I apply code changes, and the conversation ends.\n\n## Conversation Flow Best Practices\n\n- If the user wants to stop the conversation, you should respect that and stop the conversation (actionType: cancelCodeGeneration).\n\n## Common pitfalls to avoid\n\nIt is **VERY IMPORTANT** to not make the following mistakes:\n\n- Assistant wants to start code generation while the conversation is still ongoing.\n- Assistant says that it starts analysis, but it does not provide any analysis.\n- Assistant says something like \"please wait\", instead of providing a meaningful response.\n- Assistant starts code generation without requesting missing permissions.\n## Important Context\n[object Object]"
5
- },
6
- {
7
- "type": "user",
8
- "text": "Hello, GenAIcode!"
9
- },
10
- {
11
- "type": "assistant",
12
- "text": "Hello there! I guess you have a task for me today. Before we start, could you please provide me with: \n - the current source code of your application\n - the image assets (if available)\n - and conversational history (if available)\n \n Thanks",
13
- "functionCalls": [
14
- {
15
- "name": "getSourceCode"
16
- },
17
- {
18
- "name": "readHistory"
19
- }
20
- ]
21
- },
22
- {
23
- "type": "user",
24
- "functionResponses": [
25
- {
26
- "name": "getSourceCode",
27
- "content": "{\"/Users/gtanczyk/src/codegen\":{\".eslintrc.cjs\":{\"content\":null},\"README.md\":{\"content\":null},\"knip.json\":{\"content\":null},\"package.json\":{\"content\":null},\"tsconfig.json\":{\"content\":null},\"vitest.e2e.config.ts\":{\"content\":null},\"vitest.unit.config.ts\":{\"content\":null},\"vitest.workspace.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/bin\":{\"genaicode-dev.js\":{\"content\":null},\"genaicode.cjs\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/docs/design\":{\"configuration.md\":{\"content\":null},\"context_optimization_feature.md\":{\"content\":null},\"features.md\":{\"content\":null},\"file_operations.md\":{\"content\":null},\"genaicode_design_doc.md\":{\"content\":null},\"overview.md\":{\"content\":null},\"token_usage_reduction.md\":{\"content\":null},\"tri_state_codegen.md\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/docs/tasks\":{\"advanced_llm_prompt.md\":{\"content\":null},\"ai_token_usage.md\":{\"content\":null},\"allow_directory_create.md\":{\"content\":null},\"codegen_design_doc.md\":{\"content\":null},\"configurable_extensions.md\":{\"content\":null},\"content_mask.md\":{\"content\":null},\"context_shrinking.md\":{\"content\":null},\"conversation-history-management.md\":{\"content\":null},\"current_feedback.md\":{\"content\":null},\"interactive_cli.md\":{\"content\":null},\"lint_step.md\":{\"content\":null},\"multimodal_frontend.md\":{\"content\":null},\"new_config_options.md\":{\"content\":null},\"project_structure_refactor.md\":{\"content\":null},\"step_ask_question_refactor.md\":{\"content\":null},\"usage_monitoring.md\":{\"content\":null},\"web_ui.md\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/e2e-tests\":{\"genaicode-ui.test.ts\":{\"content\":null},\"project-profiles-test-utils.ts\":{\"content\":null},\"project-profiles.test.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/examples\":{\"README.md\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/examples/genaicode_plugins\":{\"fake_ai_service.ts\":{\"content\":null},\"grok_ai_service.ts\":{\"content\":null},\"nonsense_action_handler.ts\":{\"content\":null},\"nonsense_operation.ts\":{\"content\":null},\"vitest_runner.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/examples/vite_genaicode_example\":{\"vite.config.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/ai-service\":{\"ai-studio.ts\":{\"content\":null},\"anthropic.ts\":{\"content\":null},\"chat-gpt.ts\":{\"content\":null},\"common.test.ts\":{\"content\":null},\"common.ts\":{\"content\":null},\"dall-e.ts\":{\"content\":null},\"unescape-function-call.test.ts\":{\"content\":null},\"unescape-function-call.ts\":{\"content\":null},\"vertex-ai-claude.ts\":{\"content\":null},\"vertex-ai-imagen.ts\":{\"content\":null},\"vertex-ai.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/cli\":{\"cli-options.test.ts\":{\"content\":null},\"cli-options.ts\":{\"content\":null},\"cli-params.test.ts\":{\"content\":null},\"cli-params.ts\":{\"content\":null},\"service-autodetect.test.ts\":{\"content\":null},\"service-autodetect.ts\":{\"content\":null},\"validate-cli-params.test.ts\":{\"content\":null},\"validate-cli-params.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/eval\":{\"codegen-summary.test.ts\":{\"content\":null},\"current-prompt-plugin.ts\":{\"content\":null},\"prompt-debug.test.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/files\":{\"cache-file.ts\":{\"content\":null},\"file-utils.test.ts\":{\"content\":null},\"file-utils.ts\":{\"content\":null},\"find-files.ts\":{\"content\":null},\"path-utils.ts\":{\"content\":null},\"read-files.test.ts\":{\"content\":null},\"read-files.ts\":{\"content\":null},\"source-code-tree.ts\":{\"content\":null},\"temp-buffer.ts\":{\"content\":null},\"update-files.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/images\":{\"ensure-alpha.ts\":{\"content\":null},\"imgly-remove-background.ts\":{\"content\":null},\"resize-image.ts\":{\"content\":null},\"split-image.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src\":{\"index.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main\":{\"codegen-types.ts\":{\"content\":null,\"dependencies\":[]},\"codegen-utils.ts\":{\"content\":null},\"codegen.ai-services.test.ts\":{\"content\":null},\"codegen.cli-options.test.ts\":{\"content\":null},\"codegen.image-generation.test.ts\":{\"content\":null},\"codegen.test-utils.ts\":{\"content\":null},\"codegen.ts\":{\"content\":null},\"config-lib.test.ts\":{\"content\":null},\"config-lib.ts\":{\"content\":null},\"config.ts\":{\"content\":null,\"dependencies\":[{\"path\":\"path\",\"type\":\"external\"},{\"path\":\"./config-lib.js\",\"type\":\"local\"}]},\"plugin-loader.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/common\":{\"content-bus-types.ts\":{\"content\":null},\"content-bus.ts\":{\"content\":null},\"cost-collector.ts\":{\"content\":null},\"user-actions.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/interactive\":{\"codegen-interactive.test.ts\":{\"content\":null},\"codegen-interactive.ts\":{\"content\":null},\"codegen-worker.ts\":{\"content\":null},\"common.ts\":{\"content\":null},\"configure.ts\":{\"content\":null},\"error-handling.ts\":{\"content\":null},\"help.ts\":{\"content\":null},\"select-ai-service.ts\":{\"content\":null},\"task-file.ts\":{\"content\":null},\"text-prompt.ts\":{\"content\":null},\"user-action-handlers.ts\":{\"content\":null},\"user-interrupt.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/backend\":{\"api-utils.ts\":{\"content\":null},\"api.ts\":{\"content\":null},\"server.ts\":{\"content\":null},\"service.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui\":{\"codegen-ui.ts\":{\"content\":null},\"user-action-handlers.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/common\":{\"api-types.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/api\":{\"api-client.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/components\":{\"app-handlers.tsx\":{\"content\":null},\"app-layout.tsx\":{\"content\":null},\"app-state.tsx\":{\"content\":null},\"chat-interface.tsx\":{\"content\":null},\"content-generation-modal.tsx\":{\"content\":null},\"health-check-modal.tsx\":{\"content\":null},\"info-icon.tsx\":{\"content\":null},\"progress-indicator.tsx\":{\"content\":null},\"question-handler.tsx\":{\"content\":null},\"styled-textarea.tsx\":{\"content\":null},\"theme-toggle.tsx\":{\"content\":null},\"toggle-button.tsx\":{\"content\":null},\"unread-messages-notification.tsx\":{\"content\":null},\"usage-display.tsx\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/components/chat\":{\"data-container.tsx\":{\"content\":null},\"message-container.tsx\":{\"content\":null},\"system-message-container.tsx\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/components/chat/styles\":{\"chat-interface-styles.ts\":{\"content\":null},\"data-container-styles.ts\":{\"content\":null},\"message-container-styles.ts\":{\"content\":null},\"system-message-container-styles.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/components/input-area\":{\"ai-service-selector.tsx\":{\"content\":null},\"button-container.tsx\":{\"content\":null},\"codegen-options-form.tsx\":{\"content\":null},\"image-upload.tsx\":{\"content\":null},\"input-area.tsx\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app\":{\"genaicode-app.tsx\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/hooks\":{\"available-service.ts\":{\"content\":null},\"custom-events.ts\":{\"content\":null},\"merged-messages.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend/app/theme\":{\"global-style.ts\":{\"content\":null},\"styled-components.d.ts\":{\"content\":null},\"theme.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/main/ui/frontend\":{\"index.js\":{\"content\":null},\"tsconfig.json\":{\"content\":null},\"vite-env.d.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/create-directory\":{\"create-directory-def.ts\":{\"content\":null},\"create-directory-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/create-file\":{\"create-file-def.ts\":{\"content\":null},\"create-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/delete-file\":{\"delete-file-def.ts\":{\"content\":null},\"delete-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/download-file\":{\"download-file-def.ts\":{\"content\":null},\"download-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/imgly-remove-background\":{\"imgly-remove-background-def.ts\":{\"content\":null},\"imgly-remove-background-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/move-file\":{\"move-file-def.ts\":{\"content\":null},\"move-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations\":{\"operations-index.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/patch-file\":{\"patch-file-def.ts\":{\"content\":null},\"patch-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/resize-image\":{\"resize-image-def.ts\":{\"content\":null},\"resize-image-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/split-image\":{\"split-image-def.ts\":{\"content\":null},\"split-image-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/operations/update-file\":{\"update-file-def.ts\":{\"content\":null},\"update-file-executor.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/project-profiles\":{\"detection.ts\":{\"content\":null},\"index.ts\":{\"content\":null},\"types.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/project-profiles/profiles\":{\"golang.ts\":{\"content\":null},\"java-maven.ts\":{\"content\":null},\"javascript-npm.ts\":{\"content\":null},\"javascript-react.ts\":{\"content\":null},\"python-django.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/prompt\":{\"ai-service-fallback.ts\":{\"content\":null},\"function-calling-validate.ts\":{\"content\":null},\"function-calling.ts\":{\"content\":null},\"limits.test.ts\":{\"content\":null},\"limits.ts\":{\"content\":null},\"prompt-codegen.test.ts\":{\"content\":null},\"prompt-codegen.ts\":{\"content\":null},\"prompt-service-ask-question.test.ts\":{\"content\":null},\"prompt-service.ai-services.test.ts\":{\"content\":null},\"prompt-service.context-optimization.test.ts\":{\"content\":null},\"prompt-service.image-handling.test.ts\":{\"content\":null},\"prompt-service.test-utils.ts\":{\"content\":null},\"prompt-service.ts\":{\"content\":null},\"prompt-service.validation-recovery.test.ts\":{\"content\":null},\"static-prompts.ts\":{\"content\":null},\"systemprompt.test.ts\":{\"content\":null},\"systemprompt.ts\":{\"content\":null},\"token-estimator.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/prompt/function-defs\":{\"ask-question.ts\":{\"content\":null},\"codegen-planning.ts\":{\"content\":null},\"codegen-summary.ts\":{\"content\":null},\"explanation.ts\":{\"content\":null},\"generate-image.ts\":{\"content\":null},\"get-image-assets.ts\":{\"content\":null},\"get-source-code.ts\":{\"content\":null},\"optimize-context.ts\":{\"content\":null},\"read-history.ts\":{\"content\":null},\"set-summaries.ts\":{\"content\":null},\"update-history.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question/handlers\":{\"cancel-code-generation.ts\":{\"content\":null},\"code-generation.ts\":{\"content\":null},\"confirm-code-generation.ts\":{\"content\":null},\"context-optimization.ts\":{\"content\":null},\"default-action.ts\":{\"content\":null},\"handle-send-message-with-image.ts\":{\"content\":null},\"handle-send-message.ts\":{\"content\":null},\"remove-files-from-context.ts\":{\"content\":null},\"request-files-content.ts\":{\"content\":null},\"request-permissions.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ask-question\":{\"step-ask-question-types.ts\":{\"content\":null},\"step-ask-question.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/prompt/steps\":{\"step-codegen-planning.ts\":{\"content\":null},\"step-codegen-summary.test.ts\":{\"content\":null},\"step-codegen-summary.ts\":{\"content\":null},\"step-context-optimization.test.ts\":{\"content\":null},\"step-context-optimization.ts\":{\"content\":null},\"step-ensure-context.test.ts\":{\"content\":null},\"step-ensure-context.ts\":{\"content\":null,\"dependencies\":[{\"path\":\"/Users/gtanczyk/src/codegen/src/ai-service/common.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/main/codegen-types.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/main/config.js\",\"type\":\"local\"}]},\"step-generate-image.ts\":{\"content\":null},\"step-generate-summary.ts\":{\"content\":null},\"step-history-update.ts\":{\"content\":null},\"step-summarization.ts\":{\"content\":null},\"step-validate-recover.ts\":{\"content\":null},\"step-verify-patch.ts\":{\"content\":null},\"steps-types.ts\":{\"content\":null},\"steps-utils.ts\":{\"content\":null}},\"/Users/gtanczyk/src/codegen/src/vite-genaicode\":{\"README.md\":{\"content\":null},\"tsconfig.json\":{\"content\":null},\"vite-env.d.ts\":{\"content\":null},\"vite-genaicode-frontend.ts\":{\"content\":null},\"vite-genaicode-plugin.ts\":{\"content\":null}}}"
28
- },
29
- {
30
- "name": "readHistory",
31
- "content": "2024-12-08: Context Management & Code Generation Enhancement\n- Context Optimization:\n * Flex path extraction strategy\n * Robust file path detection\n * Backward compatible design\n- Key Improvements:\n * executeStepEnsureContext in planning phase\n * Dynamic context completeness check\n * Multi-strategy path resolution\n- Previous Context (UI Health Check):\n * Health Modal impl\n * Service status tracking\n * Error handling\n * React/TS frontend\n- Tech Focus:\n * Adaptive context management\n * Intelligent path detection\n * Robust code generation pipeline\n- Goals:\n * Enhanced context reliability\n * Flexible code generation\n * Improved AI service interaction"
32
- }
33
- ],
34
- "text": "Sure, here is the application source code, image assets, and the history.",
35
- "cache": true
36
- },
37
- {
38
- "type": "assistant",
39
- "text": "Thank you, I'm ready to assist you with your request."
40
- },
41
- {
42
- "type": "user",
43
- "text": "we need to create some unit tests for executeStepEnsureContext function"
44
- },
45
- {
46
- "type": "assistant",
47
- "functionCalls": [
48
- {
49
- "name": "requestFilesContent",
50
- "args": {
51
- "filePaths": [
52
- "/Users/gtanczyk/src/codegen/src/ai-service/common.ts",
53
- "/Users/gtanczyk/src/codegen/src/main/codegen-types.ts",
54
- "/Users/gtanczyk/src/codegen/src/main/config.ts",
55
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
56
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts"
57
- ]
58
- }
59
- },
60
- {
61
- "name": "getSourceCode",
62
- "args": {
63
- "filePaths": [
64
- "/Users/gtanczyk/src/codegen/src/ai-service/common.ts",
65
- "/Users/gtanczyk/src/codegen/src/main/codegen-types.ts",
66
- "/Users/gtanczyk/src/codegen/src/main/config.ts",
67
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
68
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts"
69
- ]
70
- }
71
- }
72
- ]
73
- },
74
- {
75
- "type": "user",
76
- "functionResponses": [
77
- {
78
- "name": "requestFilesContent",
79
- "content": "{\"filePaths\":[\"/Users/gtanczyk/src/codegen/src/ai-service/common.ts\",\"/Users/gtanczyk/src/codegen/src/main/codegen-types.ts\",\"/Users/gtanczyk/src/codegen/src/main/config.ts\",\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts\",\"/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts\"]}"
80
- },
81
- {
82
- "name": "getSourceCode",
83
- "content": "{\"/Users/gtanczyk/src/codegen/src/ai-service\":{\"common.ts\":{\"content\":\"import assert from 'node:assert';\\nimport { CodegenOptions, AiServiceType } from '../main/codegen-types.js';\\nimport { collectCost } from '../main/common/cost-collector.js';\\n\\nexport interface TokenUsage {\\n inputTokens: number | undefined | null;\\n outputTokens: number | undefined | null;\\n totalTokens: number | undefined | null;\\n cacheCreateTokens?: number | null;\\n cacheReadTokens?: number | null;\\n}\\n\\nexport interface FunctionDef {\\n name: string;\\n description: string;\\n parameters: {\\n type: 'object';\\n properties: Record<string, unknown>;\\n required: string[];\\n };\\n}\\n\\nexport interface FunctionCall<T = Record<string, unknown>> {\\n id?: string;\\n name: string;\\n args?: T;\\n}\\n\\nexport type PromptItemImage = {\\n mediaType: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';\\n base64url: string;\\n};\\n\\nexport interface PromptItem {\\n type: 'systemPrompt' | 'user' | 'assistant';\\n systemPrompt?: string;\\n text?: string;\\n functionResponses?: {\\n call_id?: string;\\n name: string;\\n content?: string;\\n isError?: boolean;\\n }[];\\n images?: PromptItemImage[];\\n functionCalls?: FunctionCall[];\\n cache?: boolean;\\n}\\n\\nexport type GenerateContentArgs = [\\n prompt: PromptItem[],\\n functionDefs: FunctionDef[],\\n requiredFunctionName: string | null,\\n temperature: number,\\n cheap: boolean,\\n options: CodegenOptions,\\n];\\n\\nexport type GenerateContentFunction = (...args: GenerateContentArgs) => Promise<FunctionCall[]>;\\n\\nexport type GenerateImageFunction = (\\n prompt: string,\\n contextImagePath: string | undefined,\\n size: { width: number; height: number },\\n cheap: boolean,\\n) => Promise<string>;\\n\\ninterface CostInfo {\\n aiService: AiServiceType;\\n usage: TokenUsage;\\n inputCostPerToken: number;\\n outputCostPerToken: number;\\n cheap: boolean;\\n}\\n\\n/**\\n * Common function to print token usage and estimated cost\\n * @param {CostInfo} costInfo Cost information object\\n */\\nexport function printTokenUsageAndCost(costInfo: CostInfo): void {\\n const { usage, inputCostPerToken, outputCostPerToken, cheap } = costInfo;\\n\\n console.log('Token Usage:');\\n console.log(' - Input tokens: ', usage.inputTokens ?? 0);\\n if (usage.cacheCreateTokens) {\\n console.log(' - Cache create tokens: ', usage.cacheCreateTokens);\\n }\\n if (usage.cacheReadTokens) {\\n console.log(' - Cache read tokens: ', usage.cacheReadTokens);\\n }\\n console.log(' - Output tokens: ', usage.outputTokens ?? 0);\\n console.log(' - Total tokens: ', usage.totalTokens ?? 0);\\n\\n const inputCost =\\n ((usage.inputTokens ?? 0) * inputCostPerToken +\\n (usage.cacheCreateTokens ?? 0) * inputCostPerToken * 1.25 +\\n (usage.cacheReadTokens ?? 0) * inputCostPerToken * 0.2) *\\n (cheap ? 0.1 : 1);\\n const outputCost = (usage.outputTokens ?? 0) * outputCostPerToken;\\n const totalCost = inputCost + outputCost;\\n\\n console.log(' - Estimated cost: ', totalCost.toFixed(6), ' USD');\\n\\n collectCost(totalCost, usage.inputTokens ?? 0, usage.outputTokens ?? 0, costInfo.aiService, cheap);\\n}\\n\\n/**\\n * Common function to process function calls and explanations\\n */\\nexport function processFunctionCalls(functionCalls: FunctionCall[], functionDefs: FunctionDef[]): FunctionCall[] {\\n const unknownFunctionCalls = functionCalls.filter((call) => !functionDefs.some((fd) => fd.name === call.name));\\n assert(\\n unknownFunctionCalls.length === 0,\\n 'Unknown function name: ' + unknownFunctionCalls.map((call) => call.name).join(', '),\\n );\\n\\n console.log(\\n 'Explanations:',\\n functionCalls.filter((fn) => fn.name === 'explanation').map((call) => call.args?.text),\\n );\\n\\n return functionCalls; // .filter((fn) => fn.name !== 'explanation');\\n}\\n\"}},\"/Users/gtanczyk/src/codegen/src/main\":{\"codegen-types.ts\":{\"summary\":\"Type defs\",\"dependencies\":[]},\"config.ts\":{\"content\":\"import { findRcFile, parseRcFile, RcConfig, ImportantContext, ModelOverrides } from './config-lib.js';\\nimport { loadPlugins } from './plugin-loader.js';\\nimport path from 'path';\\nimport { DEFAULT_EXTENSIONS, DEFAULT_IGNORE_PATHS } from '../project-profiles/index.js';\\n\\n// Read and parse the configuration\\nconst rcFilePath: string = await findRcFile();\\nexport const rcConfig: RcConfig = parseRcFile(rcFilePath);\\n\\nawait loadPlugins(rcConfig);\\n\\nexport const sourceExtensions: string[] = rcConfig.extensions ?? [...DEFAULT_EXTENSIONS.JS];\\n\\n// Image extensions (driven by ai service limitations, so not configurable)\\nexport const IMAGE_ASSET_EXTENSIONS: string[] = ['.png', '.jpg', '.jpeg', '.gif', '.webp'];\\n\\nexport const ignorePaths: string[] = rcConfig.ignorePaths ?? [...DEFAULT_IGNORE_PATHS.JS];\\n\\nexport const importantContext: ImportantContext = processImportantContext(rcConfig.importantContext);\\n\\nexport const modelOverrides: ModelOverrides = rcConfig.modelOverrides ?? {};\\n\\nfunction processImportantContext(context: ImportantContext | undefined): ImportantContext {\\n if (!context) return { textPrompts: [], files: [] };\\n\\n return {\\n textPrompts: context.textPrompts || [],\\n files: (context.files || []).map((file) => path.resolve(rcConfig.rootDir, file)),\\n };\\n}\\n\\nconsole.log('Detected codegen configuration', rcConfig);\\nconsole.log('Root dir:', rcConfig.rootDir);\\nconsole.log('Important context:', importantContext);\\nconsole.log('Model overrides:', modelOverrides);\\n\",\"dependencies\":[{\"path\":\"path\",\"type\":\"external\"},{\"path\":\"./config-lib.js\",\"type\":\"local\"}]}},\"/Users/gtanczyk/src/codegen/src/prompt/steps\":{\"step-ensure-context.test.ts\":{\"content\":\"import { describe, it, expect, vi, beforeEach } from 'vitest';\\nimport { executeStepEnsureContext } from './step-ensure-context';\\nimport { getSourceCode } from '../../files/read-files';\\nimport { putSystemMessage } from '../../main/common/content-bus';\\nimport { StepResult } from './steps-types';\\nimport { CodegenOptions } from '../../main/codegen-types';\\nimport '../../files/find-files.js';\\nimport { PromptItem } from '../../ai-service/common';\\n\\nimport { importantContext } from '../../main/config.js';\\n\\n// Mock dependencies\\nvi.mock('../../files/read-files');\\nvi.mock('../../files/find-files.js', () => ({\\n getSourceFiles: () => [],\\n getImageAssetFiles: () => [],\\n refreshFiles: () => null,\\n}));\\nvi.mock('../../main/common/content-bus');\\nvi.mock('../../main/config.js', () => ({\\n rootDir: '/test',\\n rcConfig: {\\n rootDir: '/test',\\n extensions: ['.js', '.ts', '.tsx', '.jsx'],\\n },\\n importantContext: {\\n files: ['/test/important.ts'],\\n },\\n}));\\n\\ndescribe('executeStepEnsureContext', () => {\\n const mockOptions: CodegenOptions = {\\n aiService: 'vertex-ai',\\n askQuestion: false,\\n };\\n\\n beforeEach(() => {\\n vi.clearAllMocks();\\n importantContext.files = ['/test/important.ts'];\\n });\\n\\n describe('Path extraction from codegenSummary', () => {\\n it('should extract paths from fileUpdates and contextPaths', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/file1.ts' }, { filePath: '/test/file2.ts' }],\\n contextPaths: ['/test/context1.ts', '/test/context2.ts'],\\n explanation: 'test',\\n },\\n };\\n\\n vi.mocked(getSourceCode).mockReturnValue({\\n '/test/file1.ts': { content: 'content1' },\\n '/test/file2.ts': { content: 'content2' },\\n '/test/context1.ts': { content: 'context1' },\\n '/test/context2.ts': { content: 'context2' },\\n '/test/important.ts': { content: 'important' },\\n });\\n\\n const prompt: PromptItem[] = [];\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.CONTINUE);\\n expect(getSourceCode).toHaveBeenCalledWith(\\n expect.objectContaining({\\n filterPaths: expect.arrayContaining([\\n '/test/file1.ts',\\n '/test/file2.ts',\\n '/test/context1.ts',\\n '/test/context2.ts',\\n '/test/important.ts',\\n ]),\\n }),\\n mockOptions,\\n );\\n });\\n\\n it('should handle empty fileUpdates and contextPaths', async () => {\\n importantContext.files = [];\\n\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [],\\n contextPaths: [],\\n explanation: 'test',\\n },\\n };\\n\\n vi.mocked(getSourceCode).mockReturnValue({});\\n\\n const prompt: PromptItem[] = [];\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.CONTINUE);\\n expect(putSystemMessage).toHaveBeenCalledWith(expect.stringContaining('No paths to ensure'));\\n });\\n });\\n\\n describe('Context checking in conversation', () => {\\n it('should identify files already in context', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/file1.ts' }],\\n contextPaths: ['/test/context1.ts'],\\n explanation: 'test',\\n },\\n };\\n\\n const prompt = [\\n {\\n type: 'user',\\n functionResponses: [\\n {\\n name: 'getSourceCode',\\n content: JSON.stringify({\\n '/test': {\\n 'file1.ts': { content: 'existing content' },\\n },\\n }),\\n },\\n ],\\n },\\n ];\\n\\n vi.mocked(getSourceCode).mockReturnValue({\\n '/test/context1.ts': { content: 'context1' },\\n '/test/important.ts': { content: 'important' },\\n });\\n\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.CONTINUE);\\n expect(getSourceCode).toHaveBeenCalledWith(\\n expect.objectContaining({\\n filterPaths: expect.arrayContaining(['/test/context1.ts', '/test/important.ts']),\\n }),\\n mockOptions,\\n );\\n });\\n\\n it('should handle both content and summary in context', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/file1.ts' }],\\n contextPaths: ['/test/context1.ts'],\\n explanation: 'test',\\n },\\n };\\n\\n const prompt = [\\n {\\n type: 'user',\\n functionResponses: [\\n {\\n name: 'getSourceCode',\\n content: JSON.stringify({\\n '/test': {\\n 'file1.ts': { content: 'existing content' },\\n 'context1.ts': { summary: 'summary only' },\\n },\\n }),\\n },\\n ],\\n },\\n ];\\n\\n vi.mocked(getSourceCode).mockReturnValue({\\n '/test/context1.ts': { content: 'context1' },\\n '/test/important.ts': { content: 'important' },\\n });\\n\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.CONTINUE);\\n expect(getSourceCode).toHaveBeenCalledWith(\\n expect.objectContaining({\\n filterPaths: expect.arrayContaining(['/test/context1.ts', '/test/important.ts']),\\n }),\\n mockOptions,\\n );\\n });\\n });\\n\\n describe('getSourceCode appending', () => {\\n it('should append getSourceCode call/response for missing files', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/new1.ts' }],\\n contextPaths: ['/test/new2.ts'],\\n explanation: 'test',\\n },\\n };\\n\\n const prompt: PromptItem[] = [];\\n vi.mocked(getSourceCode).mockReturnValue({\\n '/test/new1.ts': { content: 'new1' },\\n '/test/new2.ts': { content: 'new2' },\\n '/test/important.ts': { content: 'important' },\\n });\\n\\n await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(prompt).toHaveLength(2);\\n expect(prompt[0].type).toBe('assistant');\\n expect(prompt[0].functionCalls?.[0].name).toBe('getSourceCode');\\n expect(prompt[1].type).toBe('user');\\n expect(prompt[1].functionResponses?.[0].name).toBe('getSourceCode');\\n expect(JSON.parse(prompt[1].functionResponses?.[0].content ?? '')).toEqual({\\n '/test': {\\n 'new1.ts': { content: 'new1' },\\n 'new2.ts': { content: 'new2' },\\n 'important.ts': { content: 'important' },\\n },\\n });\\n });\\n });\\n\\n describe('Edge cases and error handling', () => {\\n it('should handle invalid getSourceCode responses in context', async () => {\\n console.warn = vi.fn();\\n\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/file1.ts' }],\\n contextPaths: [],\\n explanation: 'test',\\n },\\n };\\n\\n const prompt = [\\n {\\n type: 'user',\\n functionResponses: [\\n {\\n name: 'getSourceCode',\\n content: 'invalid json',\\n },\\n ],\\n },\\n ];\\n\\n vi.mocked(getSourceCode).mockReturnValue({\\n '/test/file1.ts': { content: 'content1' },\\n '/test/important.ts': { content: 'important' },\\n });\\n\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.CONTINUE);\\n expect(console.warn).toHaveBeenCalledWith('Failed to parse getSourceCode response:', expect.any(Error));\\n });\\n\\n it('should handle missing args in codegenSummary', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {},\\n };\\n\\n const prompt: PromptItem[] = [];\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toEqual(StepResult.BREAK);\\n });\\n\\n it('should handle getSourceCode errors', async () => {\\n const mockCodegenSummary = {\\n name: 'codegenSummary',\\n args: {\\n fileUpdates: [{ filePath: '/test/file1.ts' }],\\n contextPaths: [],\\n explanation: 'test',\\n },\\n };\\n\\n vi.mocked(getSourceCode).mockImplementation(() => {\\n throw new Error('Mock error');\\n });\\n\\n const prompt: PromptItem[] = [];\\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\\n\\n expect(result).toBe(StepResult.BREAK);\\n expect(putSystemMessage).toHaveBeenCalledWith('Error: Context completeness check failed. This is unexpected.');\\n });\\n });\\n});\\n\"},\"step-ensure-context.ts\":{\"content\":\"import { FunctionCall } from '../../ai-service/common.js';\\nimport { CodegenOptions } from '../../main/codegen-types.js';\\nimport { importantContext } from '../../main/config.js';\\nimport { getSourceCode } from '../../files/read-files.js';\\nimport { putSystemMessage } from '../../main/common/content-bus.js';\\nimport { StepResult } from './steps-types.js';\\nimport { getSourceCodeTree } from '../../files/source-code-tree.js';\\n\\n/**\\n * Executes the context completeness check step.\\n * Ensures all necessary files are included in the conversation context.\\n */\\nexport async function executeStepEnsureContext(\\n prompt: { type: string; functionResponses?: { name: string; content?: string }[]; functionCalls?: FunctionCall[] }[],\\n functionCall: FunctionCall,\\n options: CodegenOptions,\\n): Promise<StepResult> {\\n try {\\n // Extract all required paths\\n const requiredPaths = extractRequiredPaths(functionCall);\\n if (requiredPaths.length === 0) {\\n putSystemMessage('No paths to ensure in context.');\\n return StepResult.CONTINUE;\\n }\\n\\n // Get paths that are already in context\\n const existingPaths = getExistingContextPaths(prompt);\\n\\n // Find paths that are missing from context\\n const missingPaths = requiredPaths.filter((path) => !existingPaths.has(path));\\n if (missingPaths.length === 0) {\\n putSystemMessage('All required paths are already in context.');\\n return StepResult.CONTINUE;\\n }\\n\\n // Get source code for missing paths\\n putSystemMessage(`Ensuring context completeness. Adding ${missingPaths.length} missing files.`, { missingPaths });\\n const sourceCode = getSourceCode(\\n { filterPaths: missingPaths, forceAll: true, ignoreImportantFiles: true },\\n options,\\n );\\n\\n // Append getSourceCode function call/response to the prompt\\n prompt.push(\\n {\\n type: 'assistant',\\n functionCalls: [\\n {\\n name: 'getSourceCode',\\n args: {\\n filePaths: missingPaths,\\n },\\n },\\n ],\\n },\\n {\\n type: 'user',\\n functionResponses: [\\n {\\n name: 'getSourceCode',\\n content: JSON.stringify(getSourceCodeTree(sourceCode)),\\n },\\n ],\\n },\\n );\\n\\n putSystemMessage('Context completeness check completed successfully.');\\n return StepResult.CONTINUE;\\n } catch (error) {\\n putSystemMessage('Error: Context completeness check failed. This is unexpected.');\\n console.error('Context completeness check error:', error);\\n return StepResult.BREAK;\\n }\\n}\\n\\n/**\\n * Extract all required file paths from function call using flexible extraction strategies\\n */\\nfunction extractRequiredPaths(functionCall: FunctionCall): string[] {\\n const paths: string[] = [];\\n\\n // Extract paths from function call arguments\\n if (functionCall.args) {\\n // Handle codegenSummary specific structure (backward compatibility)\\n if (functionCall.name === 'codegenSummary') {\\n if (Array.isArray(functionCall.args.fileUpdates)) {\\n paths.push(\\n ...functionCall.args.fileUpdates\\n .filter((update): update is { filePath: string } => typeof update === 'object' && update !== null)\\n .map((update) => update.filePath),\\n );\\n }\\n if (Array.isArray(functionCall.args.contextPaths)) {\\n paths.push(...functionCall.args.contextPaths.filter((path): path is string => typeof path === 'string'));\\n }\\n } else if (functionCall.name === 'codegenPlanning') {\\n if (Array.isArray(functionCall.args.affectedFiles)) {\\n paths.push(...functionCall.args.affectedFiles.map((file) => [file.filePath, ...file.dependencies]).flat());\\n }\\n }\\n }\\n\\n // Add important context paths\\n const importantPaths = importantContext.files ?? [];\\n paths.push(...importantPaths);\\n\\n // Deduplicate and filter out empty/invalid paths\\n return Array.from(new Set(paths)).filter((path) => typeof path === 'string' && path.length > 0);\\n}\\n\\n/**\\n * Get paths that are already present in the conversation context\\n */\\nfunction getExistingContextPaths(prompt: { functionResponses?: { name: string; content?: string }[] }[]): Set<string> {\\n const existingPaths = new Set<string>();\\n\\n for (const item of prompt) {\\n if (!item.functionResponses) continue;\\n\\n const sourceCodeResponse = item.functionResponses.find((response) => response.name === 'getSourceCode');\\n if (!sourceCodeResponse?.content) continue;\\n\\n try {\\n const sourceCode = JSON.parse(sourceCodeResponse.content);\\n for (const [dirPath, files] of Object.entries(sourceCode)) {\\n for (const [fileName, fileInfo] of Object.entries(files as Record<string, unknown>)) {\\n const fullPath = `${dirPath}/${fileName}`;\\n if (fileInfo && typeof fileInfo === 'object' && 'content' in fileInfo && fileInfo.content !== null) {\\n existingPaths.add(fullPath);\\n }\\n }\\n }\\n } catch (error) {\\n console.warn('Failed to parse getSourceCode response:', error);\\n }\\n }\\n\\n return existingPaths;\\n}\\n\",\"dependencies\":[{\"path\":\"/Users/gtanczyk/src/codegen/src/ai-service/common.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/main/codegen-types.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/main/config.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/files/read-files.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/main/common/content-bus.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/prompt/steps/steps-types.js\",\"type\":\"local\"},{\"path\":\"/Users/gtanczyk/src/codegen/src/files/source-code-tree.js\",\"type\":\"local\"}]}}}"
84
- }
85
- ],
86
- "cache": true
87
- },
88
- {
89
- "type": "assistant",
90
- "text": "The existing test suite for executeStepEnsureContext looks comprehensive. I'll propose a few additional test cases to enhance the coverage. Would you like me to proceed with adding these tests?"
91
- },
92
- {
93
- "type": "user",
94
- "text": "I was thinking about adding a test for the codegenPlanning case"
95
- },
96
- {
97
- "type": "assistant",
98
- "text": "I noticed that the current test suite doesn't have a specific test for the codegenPlanning function call in the extractRequiredPaths method. \n\nI propose adding a test case that would:\n1. Create a mock codegenPlanning function call\n2. Include multiple affected files with their dependencies\n3. Verify that the extractRequiredPaths method correctly extracts paths from both the filePath and dependencies\n\nWould you like me to draft the test case for your review?"
99
- },
100
- {
101
- "type": "user",
102
- "text": "yes"
103
- },
104
- {
105
- "type": "assistant",
106
- "text": "Would you like me to add a test case for codegenPlanning path extraction in the executeStepEnsureContext test suite?",
107
- "functionCalls": []
108
- },
109
- {
110
- "type": "user",
111
- "text": "also if you could fix the 'should handle missing args in codegenSummary' test, I'm getting an error:\n\nContext completeness check error: TypeError: Cannot convert undefined or null to object\n at Function.entries (<anonymous>)\n at Module.getSourceCodeTree (/Users/gtanczyk/src/codegen/src/files/source-code-tree.ts:34:45)\n at Module.executeStepEnsureContext (/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts:61:37)\n at /Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts:266:28\n at file:///Users/gtanczyk/src/codegen/node_modules/@vitest/runner/dist/index.js:146:14\n at file:///Users/gtanczyk/src/codegen/node_modules/@vitest/runner/dist/index.js:61:7\n at runTest (file:///Users/gtanczyk/src/codegen/node_modules/@vitest/runner/dist/index.js:960:17)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at runSuite (file:///Users/gtanczyk/src/codegen/node_modules/@vitest/runner/dist/index.js:1116:15)\n at runSuite (file:///Users/gtanczyk/src/codegen/node_modules/@vitest/runner/dist/index.js:1116:15)\n\n\\nPlease analyze the conversation so far and help plan the implementation:\n\n1. Review the conversation history and requirements\n2. Thoughtfully analyze the problem\n3. Create a step-by-step implementation plan\n4. List all files that will be affected during implementation\n\nRemember to:\n- Consider both direct and indirect dependencies\n- Think about how changes in one file might affect others\n- Include all necessary file paths\n- Explain your reasoning for each step\n- Consider edge cases and potential issues\n\nOutput the plan using `codegenPlanning` function provding all the required fields."
112
- },
113
- {
114
- "type": "assistant",
115
- "functionCalls": [
116
- {
117
- "name": "getSourceCode",
118
- "args": {
119
- "filePaths": [
120
- "/Users/gtanczyk/src/codegen/src/files/source-code-tree.js",
121
- "/Users/gtanczyk/src/codegen/src/files/read-files.js",
122
- "/Users/gtanczyk/src/codegen/src/prompt/prompt-service.ts",
123
- "/Users/gtanczyk/src/codegen/src/main/codegen.ts",
124
- "/Users/gtanczyk/src/codegen/src/main/codegen-types.ts"
125
- ]
126
- }
127
- }
128
- ]
129
- },
130
- {
131
- "type": "user",
132
- "functionResponses": [
133
- {
134
- "name": "getSourceCode",
135
- "content": "{\"/Users/gtanczyk/src/codegen/src/main\":{\"codegen-types.ts\":{\"content\":\"import { FunctionCall, FunctionDef, GenerateContentArgs, 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 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 historyEnabled?: boolean;\\n\\n disableAiServiceFallback?: boolean;\\n conversationSummaryEnabled?: boolean;\\n images?: UploadedImage[];\\n isDev?: boolean;\\n}\\n\\n/** Hook function type for generateContent hooks */\\nexport type GenerateContentHook = (args: GenerateContentArgs, result: FunctionCall[]) => Promise<void>;\\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 /**\\n * Hook that will be executed for each generateContent function call.\\n */\\n generateContentHook?: GenerateContentHook;\\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\",\"dependencies\":[]},\"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 { askUserForConfirmation } from './common/user-actions.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\\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 userConfirmation =\\n options.interactive || options.ui\\n ? await askUserForConfirmation(\\n 'Lint command failed. Do you want to continue with code generation anyway?',\\n false,\\n )\\n : { confirmed: false };\\n\\n if (!userConfirmation.confirmed) {\\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 }\\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,\\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\\nexport function 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\",\"dependencies\":[{\"path\":\"child_process\",\"type\":\"external\"},{\"path\":\"../ai-service/vertex-ai.js\",\"type\":\"local\"},{\"path\":\"../ai-service/chat-gpt.js\",\"type\":\"local\"},{\"path\":\"../ai-service/anthropic.js\",\"type\":\"local\"},{\"path\":\"../cli/cli-params.js\",\"type\":\"local\"},{\"path\":\"../prompt/prompt-service.js\",\"type\":\"local\"},{\"path\":\"../files/update-files.js\",\"type\":\"local\"}]}},\"/Users/gtanczyk/src/codegen/src/prompt\":{\"prompt-service.ts\":{\"content\":\"import assert from 'node:assert';\\n\\nimport { getSystemPrompt } from './systemprompt.js';\\nimport { getFunctionDefs } from './function-calling.js';\\nimport { getSourceCode, getImageAssets } from '../files/read-files.js';\\nimport { PromptItem, FunctionCall, GenerateContentFunction, GenerateImageFunction } from '../ai-service/common.js';\\nimport { AiServiceType, ImagenType } from '../main/codegen-types.js';\\nimport { executeStepAskQuestion } from './steps/step-ask-question/step-ask-question.js';\\nimport { executeStepContextOptimization } from './steps/step-context-optimization.js';\\nimport { StepResult } from './steps/steps-types.js';\\nimport { CodegenPrompt } from './prompt-codegen.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';\\nimport { INITIAL_GREETING, REQUEST_SOURCE_CODE, SOURCE_CODE_RESPONSE, READY_TO_ASSIST } from './static-prompts.js';\\nimport { executeStepCodegenPlanning } from './steps/step-codegen-planning.js';\\nimport { getRegisteredGenerateContentHooks } from '../main/plugin-loader.js';\\nimport { executeStepCodegenSummary } from './steps/step-codegen-summary.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 // Get the base result from the AI service\\n const result = await handleAiServiceFallback(\\n generateContentFns,\\n codegenPrompt.options.aiService,\\n codegenPrompt.options,\\n ...args,\\n );\\n\\n // Get registered hooks for the current AI service\\n for (const hook of getRegisteredGenerateContentHooks()) {\\n await hook(args, result);\\n }\\n\\n return result;\\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: INITIAL_GREETING },\\n {\\n type: 'assistant',\\n text: REQUEST_SOURCE_CODE,\\n functionCalls: [\\n getSourceCodeRequest,\\n ...(codegenPrompt.options.vision ? [{ name: 'getImageAssets' }] : []),\\n ...(codegenPrompt.options.historyEnabled ? [{ name: 'readHistory' }] : []),\\n ],\\n },\\n ];\\n\\n const getSourceCodeResponse: PromptItem = {\\n type: 'user',\\n functionResponses: [\\n { name: 'getSourceCode', content: messages.sourceCode },\\n ...(codegenPrompt.options.vision ? [{ name: 'getImageAssets', content: messages.imageAssets }] : []),\\n ...(codegenPrompt.options.historyEnabled ? [{ name: 'readHistory', content: getCurrentHistory() }] : []),\\n ],\\n text: SOURCE_CODE_RESPONSE,\\n cache: true,\\n };\\n prompt.push(getSourceCodeResponse);\\n\\n prompt.push(\\n {\\n type: 'assistant',\\n text: READY_TO_ASSIST,\\n },\\n {\\n type: 'user',\\n text: codegenPrompt.prompt,\\n },\\n );\\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 waitIfPaused,\\n codegenPrompt.options.temperature ?? 0.7,\\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 return { result: askQuestionResult, prompt };\\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 const planningResult = await executeStepCodegenPlanning(generateContentFn, prompt, codegenPrompt.options);\\n if (planningResult === StepResult.BREAK) {\\n return { result: [], prompt };\\n }\\n\\n // Execute the codegen summary step\\n const result = await executeStepCodegenSummary(\\n generateContentFn,\\n prompt,\\n getFunctionDefs(),\\n // messages,\\n codegenPrompt.options,\\n waitIfPaused,\\n generateImageFn,\\n );\\n\\n return { result, prompt };\\n } else {\\n console.log('Code generation skipped altogether.');\\n return { result: [], prompt };\\n }\\n}\\n\\n/**\\n * Function to prepare messages for AI services\\n */\\nfunction prepareMessages(codegen: CodegenPrompt) {\\n return {\\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 };\\n}\\n\"}}}"
136
- }
137
- ]
138
- },
139
- {
140
- "type": "assistant",
141
- "functionCalls": [
142
- {
143
- "id": "toolu_011QTAwXM2ers78rNL8Apq2m",
144
- "name": "codegenPlanning",
145
- "args": {
146
- "problemAnalysis": "The issue consists of two parts:\n\n1. Adding a new test case for codegenPlanning function call in executeStepEnsureContext\n- We need to verify that the extractRequiredPaths method correctly handles codegenPlanning function calls\n- Test should check both filePath and dependencies extraction\n- Need to ensure proper mocking of getSourceCode\n\n2. Fixing the 'should handle missing args in codegenSummary' test\n- Current error occurs because getSourceCodeTree is called with undefined sourceCode\n- Need to prevent calling getSourceCode and getSourceCodeTree when there are no paths to ensure\n- Should update the test to verify proper error handling",
147
- "codeChanges": "1. Fix 'should handle missing args in codegenSummary' test:\n- Update executeStepEnsureContext to handle case when no paths are extracted\n- Update the test to verify proper error handling\n- Add proper mocking setup\n\n2. Add new test case for codegenPlanning:\n- Add new describe block for codegenPlanning path extraction\n- Create mock codegenPlanning function call with affected files and dependencies\n- Set up getSourceCode mock\n- Verify that all paths (both direct and from dependencies) are included\n- Test the complete flow through executeStepEnsureContext",
148
- "affectedFiles": [
149
- {
150
- "reason": "Main implementation file that needs to be updated to fix the missing args handling",
151
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts",
152
- "dependencies": [
153
- "/Users/gtanczyk/src/codegen/src/files/source-code-tree.js"
154
- ]
155
- },
156
- {
157
- "reason": "Test file that needs to be updated with new test cases and fixed existing test",
158
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
159
- "dependencies": [
160
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts",
161
- "/Users/gtanczyk/src/codegen/src/files/read-files.js"
162
- ]
163
- }
164
- ]
165
- }
166
- }
167
- ]
168
- },
169
- {
170
- "type": "user",
171
- "functionResponses": [
172
- {
173
- "name": "codegenPlanning",
174
- "call_id": "toolu_011QTAwXM2ers78rNL8Apq2m"
175
- }
176
- ],
177
- "cache": true
178
- },
179
- {
180
- "type": "assistant",
181
- "text": "Planning phase completed. Would you like to proceed with the planned changes?"
182
- },
183
- {
184
- "type": "user",
185
- "text": "Accept planning and continue"
186
- },
187
- {
188
- "type": "assistant",
189
- "functionCalls": [
190
- {
191
- "name": "getSourceCode",
192
- "args": {
193
- "filePaths": [
194
- "/Users/gtanczyk/src/codegen/src/files/source-code-tree.js"
195
- ]
196
- }
197
- }
198
- ]
199
- },
200
- {
201
- "type": "user",
202
- "functionResponses": [
203
- {
204
- "name": "getSourceCode",
205
- "content": "{}"
206
- }
207
- ]
208
- },
209
- {
210
- "type": "assistant",
211
- "functionCalls": [
212
- {
213
- "id": "toolu_01AjEVzki64YpyzDyn8Pr7ag",
214
- "name": "codegenSummary",
215
- "args": {
216
- "explanation": "I will implement two main changes:\n1. Fix the 'should handle missing args in codegenSummary' test by properly handling the case when no paths are extracted\n2. Add a new test case for codegenPlanning path extraction to verify both filePath and dependencies handling",
217
- "fileUpdates": [
218
- {
219
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts",
220
- "prompt": "Update executeStepEnsureContext to handle the case when no paths are extracted. Add early return before calling getSourceCode and getSourceCodeTree when there are no paths to ensure.",
221
- "updateToolName": "updateFile"
222
- },
223
- {
224
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
225
- "prompt": "1. Fix 'should handle missing args in codegenSummary' test to properly verify error handling\n2. Add new test case for codegenPlanning path extraction to verify both filePath and dependencies handling",
226
- "updateToolName": "updateFile"
227
- }
228
- ],
229
- "contextPaths": [
230
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts",
231
- "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
232
- "/Users/gtanczyk/src/codegen/src/files/source-code-tree.js"
233
- ]
234
- }
235
- }
236
- ]
237
- },
238
- {
239
- "type": "user",
240
- "functionResponses": [
241
- {
242
- "name": "codegenSummary",
243
- "call_id": "toolu_01AjEVzki64YpyzDyn8Pr7ag"
244
- }
245
- ],
246
- "cache": true,
247
- "text": "Update executeStepEnsureContext to handle the case when no paths are extracted. Add early return before calling getSourceCode and getSourceCodeTree when there are no paths to ensure."
248
- },
249
- {
250
- "type": "assistant",
251
- "functionCalls": [
252
- {
253
- "id": "toolu_01G9ny6fWZMbf5335qdwSNVV",
254
- "name": "updateFile",
255
- "args": {
256
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.ts",
257
- "explanation": "Update executeStepEnsureContext to handle the case when no paths are extracted by:\n1. Moving the return statement before getSourceCode call\n2. Improving error handling to prevent undefined being passed to getSourceCodeTree",
258
- "newContent": "import { FunctionCall } from '../../ai-service/common.js';\nimport { CodegenOptions } from '../../main/codegen-types.js';\nimport { importantContext } from '../../main/config.js';\nimport { getSourceCode } from '../../files/read-files.js';\nimport { putSystemMessage } from '../../main/common/content-bus.js';\nimport { StepResult } from './steps-types.js';\nimport { getSourceCodeTree } from '../../files/source-code-tree.js';\n\n/**\n * Executes the context completeness check step.\n * Ensures all necessary files are included in the conversation context.\n */\nexport async function executeStepEnsureContext(\n prompt: { type: string; functionResponses?: { name: string; content?: string }[]; functionCalls?: FunctionCall[] }[],\n functionCall: FunctionCall,\n options: CodegenOptions,\n): Promise<StepResult> {\n try {\n // Extract all required paths\n const requiredPaths = extractRequiredPaths(functionCall);\n if (!requiredPaths || requiredPaths.length === 0) {\n putSystemMessage('No paths to ensure in context.');\n return StepResult.CONTINUE;\n }\n\n // Get paths that are already in context\n const existingPaths = getExistingContextPaths(prompt);\n\n // Find paths that are missing from context\n const missingPaths = requiredPaths.filter((path) => !existingPaths.has(path));\n if (missingPaths.length === 0) {\n putSystemMessage('All required paths are already in context.');\n return StepResult.CONTINUE;\n }\n\n // Get source code for missing paths\n putSystemMessage(`Ensuring context completeness. Adding ${missingPaths.length} missing files.`, { missingPaths });\n const sourceCode = getSourceCode(\n { filterPaths: missingPaths, forceAll: true, ignoreImportantFiles: true },\n options,\n );\n\n // Append getSourceCode function call/response to the prompt\n prompt.push(\n {\n type: 'assistant',\n functionCalls: [\n {\n name: 'getSourceCode',\n args: {\n filePaths: missingPaths,\n },\n },\n ],\n },\n {\n type: 'user',\n functionResponses: [\n {\n name: 'getSourceCode',\n content: JSON.stringify(getSourceCodeTree(sourceCode)),\n },\n ],\n },\n );\n\n putSystemMessage('Context completeness check completed successfully.');\n return StepResult.CONTINUE;\n } catch (error) {\n putSystemMessage('Error: Context completeness check failed. This is unexpected.');\n console.error('Context completeness check error:', error);\n return StepResult.BREAK;\n }\n}\n\n/**\n * Extract all required file paths from function call using flexible extraction strategies\n */\nfunction extractRequiredPaths(functionCall: FunctionCall): string[] {\n const paths: string[] = [];\n\n // Extract paths from function call arguments\n if (functionCall.args) {\n // Handle codegenSummary specific structure (backward compatibility)\n if (functionCall.name === 'codegenSummary') {\n if (Array.isArray(functionCall.args.fileUpdates)) {\n paths.push(\n ...functionCall.args.fileUpdates\n .filter((update): update is { filePath: string } => typeof update === 'object' && update !== null)\n .map((update) => update.filePath),\n );\n }\n if (Array.isArray(functionCall.args.contextPaths)) {\n paths.push(...functionCall.args.contextPaths.filter((path): path is string => typeof path === 'string'));\n }\n } else if (functionCall.name === 'codegenPlanning') {\n if (Array.isArray(functionCall.args.affectedFiles)) {\n paths.push(...functionCall.args.affectedFiles.map((file) => [file.filePath, ...file.dependencies]).flat());\n }\n }\n }\n\n // Add important context paths\n const importantPaths = importantContext.files ?? [];\n paths.push(...importantPaths);\n\n // Deduplicate and filter out empty/invalid paths\n return Array.from(new Set(paths)).filter((path) => typeof path === 'string' && path.length > 0);\n}\n\n/**\n * Get paths that are already present in the conversation context\n */\nfunction getExistingContextPaths(prompt: { functionResponses?: { name: string; content?: string }[] }[]): Set<string> {\n const existingPaths = new Set<string>();\n\n for (const item of prompt) {\n if (!item.functionResponses) continue;\n\n const sourceCodeResponse = item.functionResponses.find((response) => response.name === 'getSourceCode');\n if (!sourceCodeResponse?.content) continue;\n\n try {\n const sourceCode = JSON.parse(sourceCodeResponse.content);\n for (const [dirPath, files] of Object.entries(sourceCode)) {\n for (const [fileName, fileInfo] of Object.entries(files as Record<string, unknown>)) {\n const fullPath = `${dirPath}/${fileName}`;\n if (fileInfo && typeof fileInfo === 'object' && 'content' in fileInfo && fileInfo.content !== null) {\n existingPaths.add(fullPath);\n }\n }\n }\n } catch (error) {\n console.warn('Failed to parse getSourceCode response:', error);\n }\n }\n\n return existingPaths;\n}"
259
- }
260
- }
261
- ]
262
- },
263
- {
264
- "type": "user",
265
- "text": "1. Fix 'should handle missing args in codegenSummary' test to properly verify error handling\n2. Add new test case for codegenPlanning path extraction to verify both filePath and dependencies handling",
266
- "functionResponses": [
267
- {
268
- "name": "updateFile",
269
- "call_id": "toolu_01G9ny6fWZMbf5335qdwSNVV"
270
- }
271
- ]
272
- },
273
- {
274
- "type": "assistant",
275
- "functionCalls": [
276
- {
277
- "id": "toolu_01MDRWtLkV2cCFKUYxqPb9CC",
278
- "name": "updateFile",
279
- "args": {
280
- "filePath": "/Users/gtanczyk/src/codegen/src/prompt/steps/step-ensure-context.test.ts",
281
- "explanation": "1. Update the 'should handle missing args in codegenSummary' test to properly verify the case when no paths are extracted\n2. Add new test cases for codegenPlanning path extraction to verify both filePath and dependencies handling\n3. Improve test organization and readability",
282
- "newContent": "import { describe, it, expect, vi, beforeEach } from 'vitest';\nimport { executeStepEnsureContext } from './step-ensure-context';\nimport { getSourceCode } from '../../files/read-files';\nimport { putSystemMessage } from '../../main/common/content-bus';\nimport { StepResult } from './steps-types';\nimport { CodegenOptions } from '../../main/codegen-types';\nimport '../../files/find-files.js';\nimport { PromptItem } from '../../ai-service/common';\n\nimport { importantContext } from '../../main/config.js';\n\n// Mock dependencies\nvi.mock('../../files/read-files');\nvi.mock('../../files/find-files.js', () => ({\n getSourceFiles: () => [],\n getImageAssetFiles: () => [],\n refreshFiles: () => null,\n}));\nvi.mock('../../main/common/content-bus');\nvi.mock('../../main/config.js', () => ({\n rootDir: '/test',\n rcConfig: {\n rootDir: '/test',\n extensions: ['.js', '.ts', '.tsx', '.jsx'],\n },\n importantContext: {\n files: ['/test/important.ts'],\n },\n}));\n\ndescribe('executeStepEnsureContext', () => {\n const mockOptions: CodegenOptions = {\n aiService: 'vertex-ai',\n askQuestion: false,\n };\n\n beforeEach(() => {\n vi.clearAllMocks();\n importantContext.files = ['/test/important.ts'];\n });\n\n describe('Path extraction from codegenSummary', () => {\n it('should extract paths from fileUpdates and contextPaths', async () => {\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/file1.ts' }, { filePath: '/test/file2.ts' }],\n contextPaths: ['/test/context1.ts', '/test/context2.ts'],\n explanation: 'test',\n },\n };\n\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/file1.ts': { content: 'content1' },\n '/test/file2.ts': { content: 'content2' },\n '/test/context1.ts': { content: 'context1' },\n '/test/context2.ts': { content: 'context2' },\n '/test/important.ts': { content: 'important' },\n });\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(getSourceCode).toHaveBeenCalledWith(\n expect.objectContaining({\n filterPaths: expect.arrayContaining([\n '/test/file1.ts',\n '/test/file2.ts',\n '/test/context1.ts',\n '/test/context2.ts',\n '/test/important.ts',\n ]),\n }),\n mockOptions,\n );\n });\n\n it('should handle empty fileUpdates and contextPaths', async () => {\n importantContext.files = [];\n\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [],\n contextPaths: [],\n explanation: 'test',\n },\n };\n\n vi.mocked(getSourceCode).mockReturnValue({});\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(putSystemMessage).toHaveBeenCalledWith('No paths to ensure in context.');\n expect(getSourceCode).not.toHaveBeenCalled();\n });\n\n it('should handle missing args in codegenSummary', async () => {\n importantContext.files = [];\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: undefined,\n };\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(putSystemMessage).toHaveBeenCalledWith('No paths to ensure in context.');\n expect(getSourceCode).not.toHaveBeenCalled();\n });\n });\n\n describe('Path extraction from codegenPlanning', () => {\n it('should extract paths from affectedFiles including dependencies', async () => {\n const mockCodegenPlanning = {\n name: 'codegenPlanning',\n args: {\n affectedFiles: [\n {\n filePath: '/test/main.ts',\n dependencies: ['/test/util1.ts', '/test/util2.ts'],\n },\n {\n filePath: '/test/component.ts',\n dependencies: ['/test/shared.ts'],\n },\n ],\n },\n };\n\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/main.ts': { content: 'main content' },\n '/test/util1.ts': { content: 'util1 content' },\n '/test/util2.ts': { content: 'util2 content' },\n '/test/component.ts': { content: 'component content' },\n '/test/shared.ts': { content: 'shared content' },\n '/test/important.ts': { content: 'important content' },\n });\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenPlanning, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(getSourceCode).toHaveBeenCalledWith(\n expect.objectContaining({\n filterPaths: expect.arrayContaining([\n '/test/main.ts',\n '/test/util1.ts',\n '/test/util2.ts',\n '/test/component.ts',\n '/test/shared.ts',\n '/test/important.ts',\n ]),\n }),\n mockOptions,\n );\n\n // Verify that all paths are included in the getSourceCode function call\n expect(prompt[0].functionCalls?.[0].args?.filePaths).toEqual(\n expect.arrayContaining([\n '/test/main.ts',\n '/test/util1.ts',\n '/test/util2.ts',\n '/test/component.ts',\n '/test/shared.ts',\n '/test/important.ts',\n ]),\n );\n\n // Verify the source code response is properly formatted\n expect(prompt[1].functionResponses?.[0].name).toBe('getSourceCode');\n const responseContent = JSON.parse(prompt[1].functionResponses?.[0].content ?? '');\n expect(responseContent['/test']).toBeDefined();\n expect(Object.keys(responseContent['/test'])).toHaveLength(6); // All files should be included\n });\n\n it('should handle empty affectedFiles in codegenPlanning', async () => {\n importantContext.files = [];\n const mockCodegenPlanning = {\n name: 'codegenPlanning',\n args: {\n affectedFiles: [],\n },\n };\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenPlanning, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(putSystemMessage).toHaveBeenCalledWith('No paths to ensure in context.');\n expect(getSourceCode).not.toHaveBeenCalled();\n });\n\n it('should handle missing affectedFiles in codegenPlanning', async () => {\n importantContext.files = [];\n const mockCodegenPlanning = {\n name: 'codegenPlanning',\n args: {},\n };\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenPlanning, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(putSystemMessage).toHaveBeenCalledWith('No paths to ensure in context.');\n expect(getSourceCode).not.toHaveBeenCalled();\n });\n });\n\n describe('Context checking in conversation', () => {\n it('should identify files already in context', async () => {\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/file1.ts' }],\n contextPaths: ['/test/context1.ts'],\n explanation: 'test',\n },\n };\n\n const prompt = [\n {\n type: 'user',\n functionResponses: [\n {\n name: 'getSourceCode',\n content: JSON.stringify({\n '/test': {\n 'file1.ts': { content: 'existing content' },\n },\n }),\n },\n ],\n },\n ];\n\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/context1.ts': { content: 'context1' },\n '/test/important.ts': { content: 'important' },\n });\n\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(getSourceCode).toHaveBeenCalledWith(\n expect.objectContaining({\n filterPaths: expect.arrayContaining(['/test/context1.ts', '/test/important.ts']),\n }),\n mockOptions,\n );\n });\n\n it('should handle both content and summary in context', async () => {\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/file1.ts' }],\n contextPaths: ['/test/context1.ts'],\n explanation: 'test',\n },\n };\n\n const prompt = [\n {\n type: 'user',\n functionResponses: [\n {\n name: 'getSourceCode',\n content: JSON.stringify({\n '/test': {\n 'file1.ts': { content: 'existing content' },\n 'context1.ts': { summary: 'summary only' },\n },\n }),\n },\n ],\n },\n ];\n\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/context1.ts': { content: 'context1' },\n '/test/important.ts': { content: 'important' },\n });\n\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(getSourceCode).toHaveBeenCalledWith(\n expect.objectContaining({\n filterPaths: expect.arrayContaining(['/test/context1.ts', '/test/important.ts']),\n }),\n mockOptions,\n );\n });\n });\n\n describe('getSourceCode appending', () => {\n it('should append getSourceCode call/response for missing files', async () => {\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/new1.ts' }],\n contextPaths: ['/test/new2.ts'],\n explanation: 'test',\n },\n };\n\n const prompt: PromptItem[] = [];\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/new1.ts': { content: 'new1' },\n '/test/new2.ts': { content: 'new2' },\n '/test/important.ts': { content: 'important' },\n });\n\n await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(prompt).toHaveLength(2);\n expect(prompt[0].type).toBe('assistant');\n expect(prompt[0].functionCalls?.[0].name).toBe('getSourceCode');\n expect(prompt[1].type).toBe('user');\n expect(prompt[1].functionResponses?.[0].name).toBe('getSourceCode');\n expect(JSON.parse(prompt[1].functionResponses?.[0].content ?? '')).toEqual({\n '/test': {\n 'new1.ts': { content: 'new1' },\n 'new2.ts': { content: 'new2' },\n 'important.ts': { content: 'important' },\n },\n });\n });\n });\n\n describe('Edge cases and error handling', () => {\n it('should handle invalid getSourceCode responses in context', async () => {\n console.warn = vi.fn();\n\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/file1.ts' }],\n contextPaths: [],\n explanation: 'test',\n },\n };\n\n const prompt = [\n {\n type: 'user',\n functionResponses: [\n {\n name: 'getSourceCode',\n content: 'invalid json',\n },\n ],\n },\n ];\n\n vi.mocked(getSourceCode).mockReturnValue({\n '/test/file1.ts': { content: 'content1' },\n '/test/important.ts': { content: 'important' },\n });\n\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.CONTINUE);\n expect(console.warn).toHaveBeenCalledWith('Failed to parse getSourceCode response:', expect.any(Error));\n });\n\n it('should handle getSourceCode errors', async () => {\n const mockCodegenSummary = {\n name: 'codegenSummary',\n args: {\n fileUpdates: [{ filePath: '/test/file1.ts' }],\n contextPaths: [],\n explanation: 'test',\n },\n };\n\n vi.mocked(getSourceCode).mockImplementation(() => {\n throw new Error('Mock error');\n });\n\n const prompt: PromptItem[] = [];\n const result = await executeStepEnsureContext(prompt, mockCodegenSummary, mockOptions);\n\n expect(result).toBe(StepResult.BREAK);\n expect(putSystemMessage).toHaveBeenCalledWith('Error: Context completeness check failed. This is unexpected.');\n });\n });\n});"
283
- }
284
- }
285
- ]
286
- },
287
- {
288
- "type": "user",
289
- "text": "Update applied.",
290
- "functionResponses": [
291
- {
292
- "name": "updateFile",
293
- "call_id": "toolu_01MDRWtLkV2cCFKUYxqPb9CC"
294
- }
295
- ]
296
- },
297
- {
298
- "type": "assistant",
299
- "text": "Code changes are generated, now what?"
300
- },
301
- {
302
- "type": "user",
303
- "text": "Apply code changes."
304
- },
305
- {
306
- "type": "assistant",
307
- "text": "There you go, code generation is complete. Can I update my history?"
308
- },
309
- {
310
- "type": "user",
311
- "text": "Yes, please update your history.\n\n- The current date: **2024-12-08T23:25:19.112Z**.\n- **Limits**:\n - Up to 250 words for the conversation summary.\n - Up to 500 words for the new history.\n- **Compression Priority**: Include as much key information as possible, even if readability and style are sacrificed.\n- **Content**: Combine crucial information from your current history and our recent conversation.\n- **Output**: Use the function call `updateHistory` with `recentConversationSummary` and `newHistoryContent`.\n\n**Instructions**:\n\n1. **Compress Aggressively**: Use abbreviations, remove unnecessary words, and focus on key terms and facts.\n2. **Retain All Key Points**: Ensure no important information from the current history or conversation is omitted.\n3. **Ignore Readability**: It's acceptable if the result is less readable, as long as it contains more information.\n4. **Use Compact Formats**: Consider lists, bullet points, or other formats that allow for dense information packing.\n5. **Write for LLM**: Human will not be reading the history content directly, it must be useful for LLM.\n \n**Current history**:\n```\n2024-12-08: Context Management & Code Generation Enhancement\n- Context Optimization:\n * Flex path extraction strategy\n * Robust file path detection\n * Backward compatible design\n- Key Improvements:\n * executeStepEnsureContext in planning phase\n * Dynamic context completeness check\n * Multi-strategy path resolution\n- Previous Context (UI Health Check):\n * Health Modal impl\n * Service status tracking\n * Error handling\n * React/TS frontend\n- Tech Focus:\n * Adaptive context management\n * Intelligent path detection\n * Robust code generation pipeline\n- Goals:\n * Enhanced context reliability\n * Flexible code generation\n * Improved AI service interaction\n```\n"
312
- }
313
- ];
314
- //# sourceMappingURL=current-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"current-prompt.js","sourceRoot":"","sources":["../../../src/eval/data/current-prompt.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;QACE,MAAM,EAAE,cAAc;QACtB,cAAc,EAAE,s0KAAs0K;KACv1K;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,mBAAmB;KAC5B;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,+QAA+Q;QACvR,eAAe,EAAE;YACf;gBACE,MAAM,EAAE,eAAe;aACxB;YACD;gBACE,MAAM,EAAE,aAAa;aACtB;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,eAAe;gBACvB,SAAS,EAAE,gxaAAgxa;aAC5xa;YACD;gBACE,MAAM,EAAE,aAAa;gBACrB,SAAS,EAAE,qrBAAqrB;aACjsB;SACF;QACD,MAAM,EAAE,2EAA2E;QACnF,OAAO,EAAE,IAAI;KACd;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,uDAAuD;KAChE;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,yEAAyE;KAClF;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,MAAM,EAAE,qBAAqB;gBAC7B,MAAM,EAAE;oBACN,WAAW,EAAE;wBACX,sDAAsD;wBACtD,uDAAuD;wBACvD,gDAAgD;wBAChD,0EAA0E;wBAC1E,qEAAqE;qBACtE;iBACF;aACF;YACD;gBACE,MAAM,EAAE,eAAe;gBACvB,MAAM,EAAE;oBACN,WAAW,EAAE;wBACX,sDAAsD;wBACtD,uDAAuD;wBACvD,gDAAgD;wBAChD,0EAA0E;wBAC1E,qEAAqE;qBACtE;iBACF;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,qBAAqB;gBAC7B,SAAS,EAAE,8UAA8U;aAC1V;YACD;gBACE,MAAM,EAAE,eAAe;gBACvB,SAAS,EAAE,m9pBAAm9pB;aAC/9pB;SACF;QACD,OAAO,EAAE,IAAI;KACd;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,mMAAmM;KAC5M;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,iEAAiE;KAC1E;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,qdAAqd;KAC9d;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,sHAAsH;QAC9H,eAAe,EAAE,EAAE;KACpB;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,irDAAirD;KAC1rD;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,MAAM,EAAE,eAAe;gBACvB,MAAM,EAAE;oBACN,WAAW,EAAE;wBACX,2DAA2D;wBAC3D,qDAAqD;wBACrD,0DAA0D;wBAC1D,iDAAiD;wBACjD,uDAAuD;qBACxD;iBACF;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,eAAe;gBACvB,SAAS,EAAE,y4qBAAy4qB;aACr5qB;SACF;KACF;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,gCAAgC;gBACtC,MAAM,EAAE,iBAAiB;gBACzB,MAAM,EAAE;oBACN,iBAAiB,EAAE,+oBAA+oB;oBAClqB,aAAa,EAAE,yjBAAyjB;oBACxkB,eAAe,EAAE;wBACf;4BACE,QAAQ,EAAE,oFAAoF;4BAC9F,UAAU,EAAE,qEAAqE;4BACjF,cAAc,EAAE;gCACd,2DAA2D;6BAC5D;yBACF;wBACD;4BACE,QAAQ,EAAE,gFAAgF;4BAC1F,UAAU,EAAE,0EAA0E;4BACtF,cAAc,EAAE;gCACd,qEAAqE;gCACrE,qDAAqD;6BACtD;yBACF;qBACF;iBACF;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,iBAAiB;gBACzB,SAAS,EAAE,gCAAgC;aAC5C;SACF;QACD,OAAO,EAAE,IAAI;KACd;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,+EAA+E;KACxF;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,8BAA8B;KACvC;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,MAAM,EAAE,eAAe;gBACvB,MAAM,EAAE;oBACN,WAAW,EAAE;wBACX,2DAA2D;qBAC5D;iBACF;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,eAAe;gBACvB,SAAS,EAAE,IAAI;aAChB;SACF;KACF;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,gCAAgC;gBACtC,MAAM,EAAE,gBAAgB;gBACxB,MAAM,EAAE;oBACN,aAAa,EAAE,4QAA4Q;oBAC3R,aAAa,EAAE;wBACb;4BACE,UAAU,EAAE,qEAAqE;4BACjF,QAAQ,EAAE,wLAAwL;4BAClM,gBAAgB,EAAE,YAAY;yBAC/B;wBACD;4BACE,UAAU,EAAE,0EAA0E;4BACtF,QAAQ,EAAE,0MAA0M;4BACpN,gBAAgB,EAAE,YAAY;yBAC/B;qBACF;oBACD,cAAc,EAAE;wBACd,qEAAqE;wBACrE,0EAA0E;wBAC1E,2DAA2D;qBAC5D;iBACF;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,gBAAgB;gBACxB,SAAS,EAAE,gCAAgC;aAC5C;SACF;QACD,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,wLAAwL;KACjM;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,gCAAgC;gBACtC,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE;oBACN,UAAU,EAAE,qEAAqE;oBACjF,aAAa,EAAE,kOAAkO;oBACjP,YAAY,EAAE,ukKAAukK;iBACtlK;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,0MAA0M;QAClN,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,YAAY;gBACpB,SAAS,EAAE,gCAAgC;aAC5C;SACF;KACF;IACD;QACE,MAAM,EAAE,WAAW;QACnB,eAAe,EAAE;YACf;gBACE,IAAI,EAAE,gCAAgC;gBACtC,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE;oBACN,UAAU,EAAE,0EAA0E;oBACtF,aAAa,EAAE,sRAAsR;oBACrS,YAAY,EAAE,0vZAA0vZ;iBACzwZ;aACF;SACF;KACF;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,iBAAiB;QACzB,mBAAmB,EAAE;YACnB;gBACE,MAAM,EAAE,YAAY;gBACpB,SAAS,EAAE,gCAAgC;aAC5C;SACF;KACF;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,uCAAuC;KAChD;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,qBAAqB;KAC9B;IACD;QACE,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,qEAAqE;KAC9E;IACD;QACE,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,+zDAA+zD;KACx0D;CACF,CAAC"}
@@ -1,49 +0,0 @@
1
- export const DEBUG_PROMPT_ASSISTANT_IMAGE: ({
2
- type: string;
3
- systemPrompt: string;
4
- text?: undefined;
5
- functionCalls?: undefined;
6
- functionResponses?: undefined;
7
- cache?: undefined;
8
- images?: undefined;
9
- } | {
10
- type: string;
11
- text: string;
12
- systemPrompt?: undefined;
13
- functionCalls?: undefined;
14
- functionResponses?: undefined;
15
- cache?: undefined;
16
- images?: undefined;
17
- } | {
18
- type: string;
19
- text: string;
20
- functionCalls: {
21
- name: string;
22
- }[];
23
- systemPrompt?: undefined;
24
- functionResponses?: undefined;
25
- cache?: undefined;
26
- images?: undefined;
27
- } | {
28
- type: string;
29
- functionResponses: {
30
- name: string;
31
- content: string;
32
- }[];
33
- text: string;
34
- cache: boolean;
35
- systemPrompt?: undefined;
36
- functionCalls?: undefined;
37
- images?: undefined;
38
- } | {
39
- type: string;
40
- text: string;
41
- images: {
42
- base64url: string;
43
- mediaType: string;
44
- }[];
45
- systemPrompt?: undefined;
46
- functionCalls?: undefined;
47
- functionResponses?: undefined;
48
- cache?: undefined;
49
- })[];