genaicode 0.0.37 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/README.md +3 -1
  2. package/bin/genaicode-dev.js +11 -0
  3. package/bin/genaicode.cjs +15 -1
  4. package/dist/ai-service/ai-studio.d.ts +6 -0
  5. package/dist/ai-service/ai-studio.js +135 -0
  6. package/dist/ai-service/ai-studio.js.map +1 -0
  7. package/dist/ai-service/anthropic.d.ts +6 -0
  8. package/dist/ai-service/anthropic.js +135 -0
  9. package/dist/ai-service/anthropic.js.map +1 -0
  10. package/dist/ai-service/chat-gpt.d.ts +5 -0
  11. package/dist/ai-service/chat-gpt.js +132 -0
  12. package/dist/ai-service/chat-gpt.js.map +1 -0
  13. package/dist/ai-service/common.d.ts +58 -0
  14. package/dist/ai-service/common.js +38 -0
  15. package/dist/ai-service/common.js.map +1 -0
  16. package/dist/ai-service/common.test.d.ts +1 -0
  17. package/dist/ai-service/common.test.js +85 -0
  18. package/dist/ai-service/common.test.js.map +1 -0
  19. package/dist/ai-service/dall-e.d.ts +14 -0
  20. package/dist/ai-service/dall-e.js +48 -0
  21. package/dist/ai-service/dall-e.js.map +1 -0
  22. package/dist/ai-service/vertex-ai-claude.d.ts +5 -0
  23. package/dist/ai-service/vertex-ai-claude.js +94 -0
  24. package/dist/ai-service/vertex-ai-claude.js.map +1 -0
  25. package/dist/ai-service/vertex-ai-imagen.d.ts +14 -0
  26. package/dist/ai-service/vertex-ai-imagen.js +77 -0
  27. package/dist/ai-service/vertex-ai-imagen.js.map +1 -0
  28. package/dist/ai-service/vertex-ai.d.ts +7 -0
  29. package/dist/ai-service/vertex-ai.js +142 -0
  30. package/dist/ai-service/vertex-ai.js.map +1 -0
  31. package/dist/cli/cli-options.d.ts +10 -0
  32. package/dist/cli/cli-options.js +124 -0
  33. package/dist/cli/cli-options.js.map +1 -0
  34. package/dist/cli/cli-options.test.d.ts +1 -0
  35. package/dist/cli/cli-options.test.js +34 -0
  36. package/dist/cli/cli-options.test.js.map +1 -0
  37. package/dist/cli/cli-params.d.ts +30 -0
  38. package/dist/cli/cli-params.js +109 -0
  39. package/dist/cli/cli-params.js.map +1 -0
  40. package/dist/cli/cli-params.test.d.ts +1 -0
  41. package/dist/cli/cli-params.test.js +38 -0
  42. package/dist/cli/cli-params.test.js.map +1 -0
  43. package/dist/cli/service-autodetect.d.ts +2 -0
  44. package/dist/cli/service-autodetect.js +17 -0
  45. package/dist/cli/service-autodetect.js.map +1 -0
  46. package/dist/cli/service-autodetect.test.d.ts +1 -0
  47. package/dist/cli/service-autodetect.test.js +38 -0
  48. package/dist/cli/service-autodetect.test.js.map +1 -0
  49. package/dist/cli/validate-cli-params.d.ts +18 -0
  50. package/dist/cli/validate-cli-params.js +129 -0
  51. package/dist/cli/validate-cli-params.js.map +1 -0
  52. package/dist/cli/validate-cli-params.test.d.ts +1 -0
  53. package/dist/cli/validate-cli-params.test.js +106 -0
  54. package/dist/cli/validate-cli-params.test.js.map +1 -0
  55. package/dist/files/file-utils.d.ts +2 -0
  56. package/dist/files/file-utils.js +7 -0
  57. package/dist/files/file-utils.js.map +1 -0
  58. package/dist/files/file-utils.test.d.ts +1 -0
  59. package/dist/files/file-utils.test.js +18 -0
  60. package/dist/files/file-utils.test.js.map +1 -0
  61. package/dist/files/find-files.d.ts +8 -0
  62. package/dist/files/find-files.js +76 -0
  63. package/dist/files/find-files.js.map +1 -0
  64. package/dist/files/read-files.d.ts +18 -0
  65. package/dist/files/read-files.js +66 -0
  66. package/dist/files/read-files.js.map +1 -0
  67. package/dist/files/read-files.test.d.ts +1 -0
  68. package/dist/files/read-files.test.js +88 -0
  69. package/dist/files/read-files.test.js.map +1 -0
  70. package/dist/files/temp-buffer.d.ts +2 -0
  71. package/dist/files/temp-buffer.js +12 -0
  72. package/dist/files/temp-buffer.js.map +1 -0
  73. package/dist/files/update-files.d.ts +6 -0
  74. package/dist/files/update-files.js +197 -0
  75. package/dist/files/update-files.js.map +1 -0
  76. package/dist/images/ensure-alpha.d.ts +1 -0
  77. package/dist/images/ensure-alpha.js +5 -0
  78. package/dist/images/ensure-alpha.js.map +1 -0
  79. package/dist/images/imgly-remove-background.d.ts +2 -0
  80. package/dist/images/imgly-remove-background.js +21 -0
  81. package/dist/images/imgly-remove-background.js.map +1 -0
  82. package/dist/images/resize-image.d.ts +19 -0
  83. package/dist/images/resize-image.js +22 -0
  84. package/dist/images/resize-image.js.map +1 -0
  85. package/dist/images/split-image.d.ts +18 -0
  86. package/dist/images/split-image.js +25 -0
  87. package/dist/images/split-image.js.map +1 -0
  88. package/dist/main/codegen-interactive-utils.d.ts +8 -0
  89. package/dist/main/codegen-interactive-utils.js +148 -0
  90. package/dist/main/codegen-interactive-utils.js.map +1 -0
  91. package/dist/main/codegen-interactive.d.ts +2 -0
  92. package/dist/main/codegen-interactive.js +68 -0
  93. package/dist/main/codegen-interactive.js.map +1 -0
  94. package/dist/main/codegen-types.d.ts +28 -0
  95. package/dist/main/codegen-types.js +2 -0
  96. package/dist/main/codegen-types.js.map +1 -0
  97. package/dist/main/codegen.d.ts +4 -0
  98. package/dist/main/codegen.js +164 -0
  99. package/dist/main/codegen.js.map +1 -0
  100. package/dist/main/codegen.test.d.ts +2 -0
  101. package/dist/main/codegen.test.js +273 -0
  102. package/dist/main/codegen.test.js.map +1 -0
  103. package/dist/main/config-lib.d.ts +16 -0
  104. package/dist/main/config-lib.js +28 -0
  105. package/dist/main/config-lib.js.map +1 -0
  106. package/dist/main/config-lib.test.d.ts +1 -0
  107. package/dist/main/config-lib.test.js +64 -0
  108. package/dist/main/config-lib.test.js.map +1 -0
  109. package/dist/main/config.d.ts +6 -0
  110. package/{src → dist}/main/config.js +28 -22
  111. package/dist/main/config.js.map +1 -0
  112. package/dist/main/interactive/codegen-interactive.d.ts +2 -0
  113. package/dist/main/interactive/codegen-interactive.js +55 -0
  114. package/dist/main/interactive/codegen-interactive.js.map +1 -0
  115. package/dist/main/interactive/codegen-interactive.test.d.ts +4 -0
  116. package/dist/main/interactive/codegen-interactive.test.js +77 -0
  117. package/dist/main/interactive/codegen-interactive.test.js.map +1 -0
  118. package/dist/main/interactive/codegen-worker.d.ts +3 -0
  119. package/dist/main/interactive/codegen-worker.js +47 -0
  120. package/dist/main/interactive/codegen-worker.js.map +1 -0
  121. package/dist/main/interactive/common.d.ts +5 -0
  122. package/dist/main/interactive/common.js +51 -0
  123. package/dist/main/interactive/common.js.map +1 -0
  124. package/dist/main/interactive/configure.d.ts +2 -0
  125. package/dist/main/interactive/configure.js +99 -0
  126. package/dist/main/interactive/configure.js.map +1 -0
  127. package/dist/main/interactive/error-handling.d.ts +4 -0
  128. package/dist/main/interactive/error-handling.js +49 -0
  129. package/dist/main/interactive/error-handling.js.map +1 -0
  130. package/dist/main/interactive/help.d.ts +1 -0
  131. package/dist/main/interactive/help.js +22 -0
  132. package/dist/main/interactive/help.js.map +1 -0
  133. package/dist/main/interactive/process-comments.d.ts +2 -0
  134. package/dist/main/interactive/process-comments.js +39 -0
  135. package/dist/main/interactive/process-comments.js.map +1 -0
  136. package/dist/main/interactive/select-ai-service.d.ts +2 -0
  137. package/dist/main/interactive/select-ai-service.js +27 -0
  138. package/dist/main/interactive/select-ai-service.js.map +1 -0
  139. package/dist/main/interactive/task-file.d.ts +2 -0
  140. package/dist/main/interactive/task-file.js +28 -0
  141. package/dist/main/interactive/task-file.js.map +1 -0
  142. package/dist/main/interactive/text-prompt.d.ts +2 -0
  143. package/dist/main/interactive/text-prompt.js +18 -0
  144. package/dist/main/interactive/text-prompt.js.map +1 -0
  145. package/dist/main/interactive/user-interrupt.d.ts +1 -0
  146. package/dist/main/interactive/user-interrupt.js +36 -0
  147. package/dist/main/interactive/user-interrupt.js.map +1 -0
  148. package/dist/main/interactive/worker-script.d.ts +1 -0
  149. package/dist/main/interactive/worker-script.js +24 -0
  150. package/dist/main/interactive/worker-script.js.map +1 -0
  151. package/dist/main/interactive/worker.d.ts +2 -0
  152. package/dist/main/interactive/worker.js +55 -0
  153. package/dist/main/interactive/worker.js.map +1 -0
  154. package/dist/prompt/function-calling-validate.d.ts +3 -0
  155. package/dist/prompt/function-calling-validate.js +33 -0
  156. package/dist/prompt/function-calling-validate.js.map +1 -0
  157. package/dist/prompt/function-calling.d.ts +5 -0
  158. package/{src → dist}/prompt/function-calling.js +25 -24
  159. package/dist/prompt/function-calling.js.map +1 -0
  160. package/dist/prompt/function-defs/ask-question.d.ts +65 -0
  161. package/dist/prompt/function-defs/ask-question.js +67 -0
  162. package/dist/prompt/function-defs/ask-question.js.map +1 -0
  163. package/dist/prompt/function-defs/codegen-summary.d.ts +63 -0
  164. package/dist/prompt/function-defs/codegen-summary.js +80 -0
  165. package/dist/prompt/function-defs/codegen-summary.js.map +1 -0
  166. package/dist/prompt/function-defs/create-directory.d.ts +21 -0
  167. package/dist/prompt/function-defs/create-directory.js +22 -0
  168. package/dist/prompt/function-defs/create-directory.js.map +1 -0
  169. package/dist/prompt/function-defs/create-file.d.ts +25 -0
  170. package/dist/prompt/function-defs/create-file.js +26 -0
  171. package/dist/prompt/function-defs/create-file.js.map +1 -0
  172. package/dist/prompt/function-defs/delete-file.d.ts +21 -0
  173. package/dist/prompt/function-defs/delete-file.js +22 -0
  174. package/dist/prompt/function-defs/delete-file.js.map +1 -0
  175. package/dist/prompt/function-defs/download-file.d.ts +25 -0
  176. package/dist/prompt/function-defs/download-file.js +26 -0
  177. package/dist/prompt/function-defs/download-file.js.map +1 -0
  178. package/dist/prompt/function-defs/explanation.d.ts +17 -0
  179. package/dist/prompt/function-defs/explanation.js +18 -0
  180. package/dist/prompt/function-defs/explanation.js.map +1 -0
  181. package/dist/prompt/function-defs/generate-image.d.ts +41 -0
  182. package/dist/prompt/function-defs/generate-image.js +42 -0
  183. package/dist/prompt/function-defs/generate-image.js.map +1 -0
  184. package/dist/prompt/function-defs/get-image-assets.d.ts +20 -0
  185. package/dist/prompt/function-defs/get-image-assets.js +21 -0
  186. package/dist/prompt/function-defs/get-image-assets.js.map +1 -0
  187. package/dist/prompt/function-defs/get-source-code.d.ts +20 -0
  188. package/dist/prompt/function-defs/get-source-code.js +21 -0
  189. package/dist/prompt/function-defs/get-source-code.js.map +1 -0
  190. package/dist/prompt/function-defs/imgly-remove-background.d.ts +25 -0
  191. package/dist/prompt/function-defs/imgly-remove-background.js +26 -0
  192. package/dist/prompt/function-defs/imgly-remove-background.js.map +1 -0
  193. package/dist/prompt/function-defs/move-file.d.ts +25 -0
  194. package/dist/prompt/function-defs/move-file.js +26 -0
  195. package/dist/prompt/function-defs/move-file.js.map +1 -0
  196. package/dist/prompt/function-defs/patch-file.d.ts +25 -0
  197. package/dist/prompt/function-defs/patch-file.js +39 -0
  198. package/dist/prompt/function-defs/patch-file.js.map +1 -0
  199. package/dist/prompt/function-defs/resize-image.d.ts +36 -0
  200. package/dist/prompt/function-defs/resize-image.js +37 -0
  201. package/dist/prompt/function-defs/resize-image.js.map +1 -0
  202. package/dist/prompt/function-defs/split-image.d.ts +57 -0
  203. package/dist/prompt/function-defs/split-image.js +46 -0
  204. package/dist/prompt/function-defs/split-image.js.map +1 -0
  205. package/dist/prompt/function-defs/update-file.d.ts +25 -0
  206. package/dist/prompt/function-defs/update-file.js +26 -0
  207. package/dist/prompt/function-defs/update-file.js.map +1 -0
  208. package/dist/prompt/limits.d.ts +3 -0
  209. package/dist/prompt/limits.js +19 -0
  210. package/dist/prompt/limits.js.map +1 -0
  211. package/dist/prompt/limits.test.d.ts +1 -0
  212. package/dist/prompt/limits.test.js +35 -0
  213. package/dist/prompt/limits.test.js.map +1 -0
  214. package/dist/prompt/prompt-codegen.d.ts +9 -0
  215. package/dist/prompt/prompt-codegen.js +90 -0
  216. package/dist/prompt/prompt-codegen.js.map +1 -0
  217. package/dist/prompt/prompt-codegen.test.d.ts +1 -0
  218. package/dist/prompt/prompt-codegen.test.js +98 -0
  219. package/dist/prompt/prompt-codegen.test.js.map +1 -0
  220. package/dist/prompt/prompt-consts.d.ts +1 -0
  221. package/{src → dist}/prompt/prompt-consts.js +1 -0
  222. package/dist/prompt/prompt-consts.js.map +1 -0
  223. package/dist/prompt/prompt-service-ask-question.test.d.ts +3 -0
  224. package/dist/prompt/prompt-service-ask-question.test.js +142 -0
  225. package/dist/prompt/prompt-service-ask-question.test.js.map +1 -0
  226. package/dist/prompt/prompt-service.d.ts +28 -0
  227. package/dist/prompt/prompt-service.js +163 -0
  228. package/dist/prompt/prompt-service.js.map +1 -0
  229. package/dist/prompt/prompt-service.test.d.ts +1 -0
  230. package/dist/prompt/prompt-service.test.js +531 -0
  231. package/dist/prompt/prompt-service.test.js.map +1 -0
  232. package/dist/prompt/steps/step-ask-question.d.ts +6 -0
  233. package/dist/prompt/steps/step-ask-question.js +82 -0
  234. package/dist/prompt/steps/step-ask-question.js.map +1 -0
  235. package/dist/prompt/steps/step-generate-image.d.ts +2 -0
  236. package/dist/prompt/steps/step-generate-image.js +29 -0
  237. package/dist/prompt/steps/step-generate-image.js.map +1 -0
  238. package/dist/prompt/steps/step-validate-recover.d.ts +13 -0
  239. package/dist/prompt/steps/step-validate-recover.js +51 -0
  240. package/dist/prompt/steps/step-validate-recover.js.map +1 -0
  241. package/dist/prompt/steps/step-verify-patch.d.ts +7 -0
  242. package/dist/prompt/steps/step-verify-patch.js +41 -0
  243. package/dist/prompt/steps/step-verify-patch.js.map +1 -0
  244. package/dist/prompt/steps/steps-types.d.ts +4 -0
  245. package/dist/prompt/steps/steps-types.js +6 -0
  246. package/dist/prompt/steps/steps-types.js.map +1 -0
  247. package/dist/prompt/systemprompt.d.ts +3 -0
  248. package/dist/prompt/systemprompt.js +47 -0
  249. package/dist/prompt/systemprompt.js.map +1 -0
  250. package/dist/prompt/systemprompt.test.d.ts +3 -0
  251. package/dist/prompt/systemprompt.test.js +46 -0
  252. package/dist/prompt/systemprompt.test.js.map +1 -0
  253. package/package.json +15 -5
  254. package/bin/genaicode.js +0 -5
  255. package/bin/vertex-monkey-patch.cjs +0 -33
  256. package/src/ai-service/anthropic.js +0 -126
  257. package/src/ai-service/chat-gpt.js +0 -126
  258. package/src/ai-service/common.js +0 -49
  259. package/src/ai-service/common.test.js +0 -107
  260. package/src/ai-service/dall-e.js +0 -50
  261. package/src/ai-service/vertex-ai-claude.js +0 -99
  262. package/src/ai-service/vertex-ai-imagen.js +0 -78
  263. package/src/ai-service/vertex-ai.js +0 -156
  264. package/src/cli/cli-options.js +0 -132
  265. package/src/cli/cli-options.test.js +0 -50
  266. package/src/cli/cli-params.js +0 -114
  267. package/src/cli/cli-params.test.js +0 -43
  268. package/src/cli/service-autodetect.js +0 -11
  269. package/src/cli/service-autodetect.test.js +0 -43
  270. package/src/cli/validate-cli-params.js +0 -137
  271. package/src/cli/validate-cli-params.test.js +0 -134
  272. package/src/files/file-utils.js +0 -7
  273. package/src/files/file-utils.test.js +0 -21
  274. package/src/files/find-files.js +0 -86
  275. package/src/files/read-files.js +0 -65
  276. package/src/files/read-files.test.js +0 -103
  277. package/src/files/temp-buffer.js +0 -13
  278. package/src/files/update-files.js +0 -205
  279. package/src/images/ensure-alpha.js +0 -5
  280. package/src/images/imgly-remove-background.js +0 -23
  281. package/src/images/resize-image.js +0 -23
  282. package/src/images/split-image.js +0 -26
  283. package/src/main/codegen.js +0 -120
  284. package/src/main/codegen.test.js +0 -335
  285. package/src/main/config-lib.js +0 -33
  286. package/src/main/config-lib.test.js +0 -80
  287. package/src/prompt/function-calling-validate.js +0 -25
  288. package/src/prompt/function-defs/ask-question.js +0 -33
  289. package/src/prompt/function-defs/codegen-summary.js +0 -87
  290. package/src/prompt/function-defs/create-directory.js +0 -21
  291. package/src/prompt/function-defs/create-file.js +0 -26
  292. package/src/prompt/function-defs/delete-file.js +0 -21
  293. package/src/prompt/function-defs/download-file.js +0 -25
  294. package/src/prompt/function-defs/explanation.js +0 -17
  295. package/src/prompt/function-defs/generate-image.js +0 -51
  296. package/src/prompt/function-defs/get-image-assets.js +0 -21
  297. package/src/prompt/function-defs/get-source-code.js +0 -21
  298. package/src/prompt/function-defs/imgly-remove-background.js +0 -25
  299. package/src/prompt/function-defs/move-file.js +0 -25
  300. package/src/prompt/function-defs/patch-file.js +0 -39
  301. package/src/prompt/function-defs/resize-image.js +0 -36
  302. package/src/prompt/function-defs/split-image.js +0 -45
  303. package/src/prompt/function-defs/update-file.js +0 -26
  304. package/src/prompt/limits.js +0 -23
  305. package/src/prompt/limits.test.js +0 -40
  306. package/src/prompt/prompt-codegen.js +0 -106
  307. package/src/prompt/prompt-codegen.test.js +0 -116
  308. package/src/prompt/prompt-service-ask-question.test.js +0 -163
  309. package/src/prompt/prompt-service.js +0 -335
  310. package/src/prompt/prompt-service.test.js +0 -602
  311. package/src/prompt/systemprompt.js +0 -39
  312. package/src/prompt/systemprompt.test.js +0 -64
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Function definition for patchFile
3
+ */
4
+ export declare const patchFile: {
5
+ readonly name: "patchFile";
6
+ readonly description: "Partially update a file content. The file must already exists in the application source code. The function should be called only if there is a need to actually change something.";
7
+ readonly parameters: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly filePath: {
11
+ readonly type: "string";
12
+ readonly description: "The file path to patch.";
13
+ };
14
+ readonly patch: {
15
+ readonly type: "string";
16
+ readonly description: "Modification to the file expressed in patch format. Example patch:\n\n```\nIndex: filename.js\n===================================================================\n--- filename.js\n+++ filename.js\n@@ -1,2 +1,3 @@\n line1\n+line3\n line2\n\\n```\n ";
17
+ };
18
+ readonly explanation: {
19
+ readonly type: "string";
20
+ readonly description: "The explanation of the reasoning behind the suggested code changes for this file";
21
+ };
22
+ };
23
+ readonly required: readonly ["filePath", "patch"];
24
+ };
25
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Function definition for patchFile
3
+ */
4
+ export const patchFile = {
5
+ name: 'patchFile',
6
+ description: 'Partially update a file content. The file must already exists in the application source code. The function should be called only if there is a need to actually change something.',
7
+ parameters: {
8
+ type: 'object',
9
+ properties: {
10
+ filePath: {
11
+ type: 'string',
12
+ description: 'The file path to patch.',
13
+ },
14
+ patch: {
15
+ type: 'string',
16
+ description: `Modification to the file expressed in patch format. Example patch:
17
+
18
+ \`\`\`
19
+ Index: filename.js
20
+ ===================================================================
21
+ --- filename.js
22
+ +++ filename.js
23
+ @@ -1,2 +1,3 @@
24
+ line1
25
+ +line3
26
+ line2
27
+ \
28
+ \`\`\`
29
+ `,
30
+ },
31
+ explanation: {
32
+ type: 'string',
33
+ description: 'The explanation of the reasoning behind the suggested code changes for this file',
34
+ },
35
+ },
36
+ required: ['filePath', 'patch'],
37
+ },
38
+ };
39
+ //# sourceMappingURL=patch-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/patch-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,mLAAmL;IACrL,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;aACvC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;;;;;;;;;;;;;WAaV;aACJ;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kFAAkF;aAChG;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;KAChC;CACO,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Function definition for resizeImage
3
+ */
4
+ export declare const resizeImage: {
5
+ readonly name: "resizeImage";
6
+ readonly description: "Resize image to the desired size";
7
+ readonly parameters: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly filePath: {
11
+ readonly type: "string";
12
+ readonly description: "The file path of the image.";
13
+ };
14
+ readonly size: {
15
+ readonly type: "object";
16
+ readonly properties: {
17
+ readonly width: {
18
+ readonly type: "number";
19
+ readonly description: "width of the image";
20
+ };
21
+ readonly height: {
22
+ readonly type: "number";
23
+ readonly description: "height of the image";
24
+ };
25
+ };
26
+ readonly required: readonly ["width", "height"];
27
+ readonly description: "The size of the image to generate.";
28
+ };
29
+ readonly explanation: {
30
+ readonly type: "string";
31
+ readonly description: "The explanation of the reasoning behind removing the background from this image";
32
+ };
33
+ };
34
+ readonly required: readonly ["filePath", "size"];
35
+ };
36
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Function definition for resizeImage
3
+ */
4
+ export const resizeImage = {
5
+ name: 'resizeImage',
6
+ description: 'Resize image to the desired size',
7
+ parameters: {
8
+ type: 'object',
9
+ properties: {
10
+ filePath: {
11
+ type: 'string',
12
+ description: 'The file path of the image.',
13
+ },
14
+ size: {
15
+ type: 'object',
16
+ properties: {
17
+ width: {
18
+ type: 'number',
19
+ description: 'width of the image',
20
+ },
21
+ height: {
22
+ type: 'number',
23
+ description: 'height of the image',
24
+ },
25
+ },
26
+ required: ['width', 'height'],
27
+ description: 'The size of the image to generate.',
28
+ },
29
+ explanation: {
30
+ type: 'string',
31
+ description: 'The explanation of the reasoning behind removing the background from this image',
32
+ },
33
+ },
34
+ required: ['filePath', 'size'],
35
+ },
36
+ };
37
+ //# sourceMappingURL=resize-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resize-image.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/resize-image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,kCAAkC;IAC/C,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,oBAAoB;qBAClC;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,qBAAqB;qBACnC;iBACF;gBACD,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;gBAC7B,WAAW,EAAE,oCAAoC;aAClD;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iFAAiF;aAC/F;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;KAC/B;CACO,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Function definition for splitImage
3
+ */
4
+ export declare const splitImage: {
5
+ readonly name: "splitImage";
6
+ readonly description: "Split an image into multiple parts and save them as separate files.";
7
+ readonly parameters: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly inputFilePath: {
11
+ readonly type: "string";
12
+ readonly description: "The file path of the input image to be split.";
13
+ };
14
+ readonly parts: {
15
+ readonly type: "array";
16
+ readonly items: {
17
+ readonly type: "object";
18
+ readonly properties: {
19
+ readonly rect: {
20
+ readonly type: "object";
21
+ readonly properties: {
22
+ readonly x: {
23
+ readonly type: "number";
24
+ readonly description: "The x-coordinate of the top-left corner of the rectangle.";
25
+ };
26
+ readonly y: {
27
+ readonly type: "number";
28
+ readonly description: "The y-coordinate of the top-left corner of the rectangle.";
29
+ };
30
+ readonly width: {
31
+ readonly type: "number";
32
+ readonly description: "The width of the rectangle.";
33
+ };
34
+ readonly height: {
35
+ readonly type: "number";
36
+ readonly description: "The height of the rectangle.";
37
+ };
38
+ };
39
+ readonly required: readonly ["x", "y", "width", "height"];
40
+ };
41
+ readonly outputFilePath: {
42
+ readonly type: "string";
43
+ readonly description: "The file path to save the extracted part of the image.";
44
+ };
45
+ };
46
+ readonly required: readonly ["rect", "outputFilePath"];
47
+ };
48
+ readonly description: "An array of parts to extract from the image, each with a rectangle and output file path.";
49
+ };
50
+ readonly explanation: {
51
+ readonly type: "string";
52
+ readonly description: "The explanation of the reasoning behind splitting this image";
53
+ };
54
+ };
55
+ readonly required: readonly ["inputFilePath", "parts"];
56
+ };
57
+ };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Function definition for splitImage
3
+ */
4
+ export const splitImage = {
5
+ name: 'splitImage',
6
+ description: 'Split an image into multiple parts and save them as separate files.',
7
+ parameters: {
8
+ type: 'object',
9
+ properties: {
10
+ inputFilePath: {
11
+ type: 'string',
12
+ description: 'The file path of the input image to be split.',
13
+ },
14
+ parts: {
15
+ type: 'array',
16
+ items: {
17
+ type: 'object',
18
+ properties: {
19
+ rect: {
20
+ type: 'object',
21
+ properties: {
22
+ x: { type: 'number', description: 'The x-coordinate of the top-left corner of the rectangle.' },
23
+ y: { type: 'number', description: 'The y-coordinate of the top-left corner of the rectangle.' },
24
+ width: { type: 'number', description: 'The width of the rectangle.' },
25
+ height: { type: 'number', description: 'The height of the rectangle.' },
26
+ },
27
+ required: ['x', 'y', 'width', 'height'],
28
+ },
29
+ outputFilePath: {
30
+ type: 'string',
31
+ description: 'The file path to save the extracted part of the image.',
32
+ },
33
+ },
34
+ required: ['rect', 'outputFilePath'],
35
+ },
36
+ description: 'An array of parts to extract from the image, each with a rectangle and output file path.',
37
+ },
38
+ explanation: {
39
+ type: 'string',
40
+ description: 'The explanation of the reasoning behind splitting this image',
41
+ },
42
+ },
43
+ required: ['inputFilePath', 'parts'],
44
+ },
45
+ };
46
+ //# sourceMappingURL=split-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"split-image.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/split-image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,qEAAqE;IAClF,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+CAA+C;aAC7D;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACV,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;gCAC/F,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;gCAC/F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;gCACrE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;6BACxE;4BACD,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC;yBACxC;wBACD,cAAc,EAAE;4BACd,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,wDAAwD;yBACtE;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC;iBACrC;gBACD,WAAW,EAAE,0FAA0F;aACxG;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8DAA8D;aAC5E;SACF;QACD,QAAQ,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC;KACrC;CACO,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Function definition for updateFile
3
+ */
4
+ export declare const updateFile: {
5
+ readonly name: "updateFile";
6
+ readonly description: "Update a file with new content. The file must already exists in the application source code. The function should be called only if there is a need to actually change something.";
7
+ readonly parameters: {
8
+ readonly type: "object";
9
+ readonly properties: {
10
+ readonly filePath: {
11
+ readonly type: "string";
12
+ readonly description: "The file path to update.";
13
+ };
14
+ readonly newContent: {
15
+ readonly type: "string";
16
+ readonly description: "The content to update the file with. Must not be empty.";
17
+ };
18
+ readonly explanation: {
19
+ readonly type: "string";
20
+ readonly description: "The explanation of the reasoning behind the suggested code changes for this file";
21
+ };
22
+ };
23
+ readonly required: readonly ["filePath", "newContent"];
24
+ };
25
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Function definition for updateFile
3
+ */
4
+ export const updateFile = {
5
+ name: 'updateFile',
6
+ description: 'Update a file with new content. The file must already exists in the application source code. The function should be called only if there is a need to actually change something.',
7
+ parameters: {
8
+ type: 'object',
9
+ properties: {
10
+ filePath: {
11
+ type: 'string',
12
+ description: 'The file path to update.',
13
+ },
14
+ newContent: {
15
+ type: 'string',
16
+ description: 'The content to update the file with. Must not be empty.',
17
+ },
18
+ explanation: {
19
+ type: 'string',
20
+ description: 'The explanation of the reasoning behind the suggested code changes for this file',
21
+ },
22
+ },
23
+ required: ['filePath', 'newContent'],
24
+ },
25
+ };
26
+ //# sourceMappingURL=update-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/update-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,kLAAkL;IACpL,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kFAAkF;aAChG;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;KACrC;CACO,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function verifySystemPromptLimit(systemPrompt: string): void;
2
+ export declare function verifyCodegenPromptLimit(codeGenPrompt: string): void;
3
+ export declare function verifySourceCodeLimit(sourceCode: string): void;
@@ -0,0 +1,19 @@
1
+ import assert from 'node:assert';
2
+ const SYSTEM_PROMPT_LIMIT = 450;
3
+ const CODEGEN_PROMPT_LIMIT = 500;
4
+ const SOURCE_CODE_LIMIT = 40000;
5
+ function verifyPromptLimit(promptType, prompt, limit) {
6
+ const tokenCount = prompt.split(/\s+/).length;
7
+ console.log(`${promptType} prompt token count: ${tokenCount}`);
8
+ assert(tokenCount <= limit, `Token limit exceeded: ${tokenCount} > ${limit}`);
9
+ }
10
+ export function verifySystemPromptLimit(systemPrompt) {
11
+ verifyPromptLimit('system', systemPrompt, SYSTEM_PROMPT_LIMIT);
12
+ }
13
+ export function verifyCodegenPromptLimit(codeGenPrompt) {
14
+ verifyPromptLimit('codegen', codeGenPrompt, CODEGEN_PROMPT_LIMIT);
15
+ }
16
+ export function verifySourceCodeLimit(sourceCode) {
17
+ verifyPromptLimit('sourceCode', sourceCode, SOURCE_CODE_LIMIT);
18
+ }
19
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/prompt/limits.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AACjC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,SAAS,iBAAiB,CAAC,UAAkB,EAAE,MAAc,EAAE,KAAa;IAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,UAAU,wBAAwB,UAAU,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,UAAU,IAAI,KAAK,EAAE,yBAAyB,UAAU,MAAM,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,YAAoB;IAC1D,iBAAiB,CAAC,QAAQ,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,aAAqB;IAC5D,iBAAiB,CAAC,SAAS,EAAE,aAAa,EAAE,oBAAoB,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,iBAAiB,CAAC,YAAY,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { verifySystemPromptLimit, verifyCodegenPromptLimit, verifySourceCodeLimit } from './limits.js';
3
+ describe('Prompt Limits', () => {
4
+ describe('verifySystemPromptLimit', () => {
5
+ it('should not throw for a prompt within the limit', () => {
6
+ const validPrompt = 'A '.repeat(200 - 1);
7
+ expect(() => verifySystemPromptLimit(validPrompt)).not.toThrow();
8
+ });
9
+ it('should throw for a prompt exceeding the limit', () => {
10
+ const invalidPrompt = 'A '.repeat(451);
11
+ expect(() => verifySystemPromptLimit(invalidPrompt)).toThrow('Token limit exceeded: 452 > 450');
12
+ });
13
+ });
14
+ describe('verifyCodegenPromptLimit', () => {
15
+ it('should not throw for a prompt within the limit', () => {
16
+ const validPrompt = 'B '.repeat(200 - 1);
17
+ expect(() => verifyCodegenPromptLimit(validPrompt)).not.toThrow();
18
+ });
19
+ it('should throw for a prompt exceeding the limit', () => {
20
+ const invalidPrompt = 'B '.repeat(501);
21
+ expect(() => verifyCodegenPromptLimit(invalidPrompt)).toThrow('Token limit exceeded: 502 > 500');
22
+ });
23
+ });
24
+ describe('verifySourceCodeLimit', () => {
25
+ it('should not throw for source code within the limit', () => {
26
+ const validSourceCode = 'C '.repeat(40000 - 1);
27
+ expect(() => verifySourceCodeLimit(validSourceCode)).not.toThrow();
28
+ });
29
+ it('should throw for source code exceeding the limit', () => {
30
+ const invalidSourceCode = 'C '.repeat(40001);
31
+ expect(() => verifySourceCodeLimit(invalidSourceCode)).toThrow('Token limit exceeded: 40002 > 40000');
32
+ });
33
+ });
34
+ });
35
+ //# sourceMappingURL=limits.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.test.js","sourceRoot":"","sources":["../../src/prompt/limits.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEvG,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACvC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACnE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;QAClG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACvC,MAAM,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;YAC3D,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YAC/C,MAAM,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACrE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7C,MAAM,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,qCAAqC,CAAC,CAAC;QACxG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { CodegenOptions } from '../main/codegen-types.js';
2
+ export interface CodegenPrompt {
3
+ prompt: string;
4
+ options: CodegenOptions;
5
+ }
6
+ /** Get codegen prompt */
7
+ export declare function getCodeGenPrompt(options: CodegenOptions): CodegenPrompt;
8
+ /** Get lint fix prompt */
9
+ export declare function getLintFixPrompt(command: string, { verbose }: CodegenOptions, stdout: string, stderr: string): string;
@@ -0,0 +1,90 @@
1
+ import assert from 'node:assert';
2
+ import { getSourceCode } from '../files/read-files.js';
3
+ import { CODEGEN_TRIGGER } from './prompt-consts.js';
4
+ import { getDependencyList } from '../files/find-files.js';
5
+ import { verifyCodegenPromptLimit } from './limits.js';
6
+ import { importantContext } from '../main/config.js';
7
+ /** Get codegen prompt */
8
+ export function getCodeGenPrompt(options) {
9
+ let { explicitPrompt } = options;
10
+ const { taskFile, considerAllFiles, allowFileCreate, allowFileDelete, allowDirectoryCreate, allowFileMove, vision, imagen, dependencyTree, verbose, askQuestion, interactive, } = options;
11
+ assert(!explicitPrompt || !taskFile, 'Both taskFile and explicitPrompt are not allowed');
12
+ if (taskFile) {
13
+ explicitPrompt = `I want you to perform a coding task. The task is described in the ${taskFile} file. Use those instructions.`;
14
+ }
15
+ let codeGenFiles;
16
+ if (considerAllFiles) {
17
+ codeGenFiles = Object.keys(getSourceCode({ taskFile, forceAll: true }, options));
18
+ }
19
+ else {
20
+ codeGenFiles = Object.entries(getSourceCode({ taskFile, forceAll: true }, options))
21
+ .filter(([, { content }]) => content?.match(new RegExp(`([^'^\`]+)${CODEGEN_TRIGGER}`)))
22
+ .map(([path]) => path);
23
+ }
24
+ // Add logic to consider dependency tree
25
+ if (dependencyTree) {
26
+ assert(codeGenFiles.length > 0, `You must use ${CODEGEN_TRIGGER} together with --dependency-tree`);
27
+ const dependencyTreeFiles = new Set();
28
+ codeGenFiles
29
+ .map(getDependencyList)
30
+ .flat()
31
+ .forEach((key) => dependencyTreeFiles.add(key));
32
+ codeGenFiles = Array.from(dependencyTreeFiles);
33
+ }
34
+ const importantTextPrompts = importantContext.textPrompts?.map((prompt) => prompt.content).join('\n\n') || '';
35
+ const requestPermissionText = askQuestion && interactive ? ' (request permission via `askQuestion`)' : '';
36
+ const codeGenPrompt = (explicitPrompt ? 'This is your task: ' + explicitPrompt + '\n\n' : '') +
37
+ `${considerAllFiles
38
+ ? codeGenFiles.length > 0
39
+ ? `I have marked some files with the ${CODEGEN_TRIGGER} fragments:\n${codeGenFiles.join('\n')}`
40
+ : `No files are marked with ${CODEGEN_TRIGGER} fragment, so you can consider doing changes in any file.`
41
+ : codeGenFiles.length > 0
42
+ ? `Generate updates only for the following files:\n${codeGenFiles.join('\n')}\n`
43
+ : ''}
44
+ My additional requirements for task execution are:
45
+ ${importantTextPrompts ? `${importantTextPrompts}\n` : ''}
46
+ ${considerAllFiles
47
+ ? 'You are allowed to modify all files in the application regardless if they contain codegen fragments or not.'
48
+ : 'Do not modify files which do not contain the fragments.'}
49
+ ${allowFileCreate ? 'You are allowed to create new files.' : 'Do not create new files. (request permission via `askQuestion`)'}
50
+ ${allowFileDelete
51
+ ? 'You are allowed to delete files, in such case add empty string as content.'
52
+ : 'Do not delete files. (request permission via `askQuestion`)'}
53
+ ${allowDirectoryCreate ? 'You are allowed to create new directories.' : `Do not create new directories.${requestPermissionText}`}
54
+ ${allowFileMove ? 'You are allowed to move files.' : 'Do not move files. (request permission via `askQuestion`)'}
55
+ ${vision ? 'You are allowed to analyze image assets.' : 'Do not analyze image assets. (request permission via `askQuestion`)'}
56
+ ${imagen ? 'You are allowed to generate images.' : 'You are not allowed to generate images. (request permission via `askQuestion`)'}
57
+ `;
58
+ if (verbose) {
59
+ console.log('Code gen prompt:');
60
+ console.log(codeGenPrompt);
61
+ }
62
+ verifyCodegenPromptLimit(codeGenPrompt);
63
+ return { prompt: codeGenPrompt, options };
64
+ }
65
+ /** Get lint fix prompt */
66
+ export function getLintFixPrompt(command, { verbose }, stdout, stderr) {
67
+ const lintFixPrompt = `The following lint errors were encountered after the initial code generation:
68
+
69
+ Lint command: ${command}
70
+ Lint command stdout:
71
+
72
+ \`\`\`
73
+ ${stdout}
74
+ \`\`\`
75
+
76
+ Lint command stderr:
77
+
78
+ \`\`\`
79
+ ${stderr}
80
+ \`\`\`
81
+
82
+ Please suggest changes to fix these lint errors.`;
83
+ if (verbose) {
84
+ console.log('Lint fix prompt:');
85
+ console.log(lintFixPrompt);
86
+ }
87
+ verifyCodegenPromptLimit(lintFixPrompt);
88
+ return lintFixPrompt;
89
+ }
90
+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AAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC7B,CAAC;IAED,wBAAwB,CAAC,aAAa,CAAC,CAAC;IAExC,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1 @@
1
+ import '../files/read-files.js';
@@ -0,0 +1,98 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+ import { getCodeGenPrompt, getLintFixPrompt } from './prompt-codegen.js';
3
+ import * as findFiles from '../files/find-files.js';
4
+ import * as cliParams from '../cli/cli-params.js';
5
+ import * as limits from './limits.js';
6
+ import '../files/read-files.js';
7
+ vi.mock('../files/find-files.js', () => ({
8
+ rcConfig: {},
9
+ getSourceFiles: vi.fn(),
10
+ }));
11
+ vi.mock('../files/read-files.js', () => ({
12
+ getSourceCode: () => ({}),
13
+ }));
14
+ vi.mock('../cli/cli-params.js', () => ({
15
+ requireExplanations: false,
16
+ considerAllFiles: false,
17
+ dependencyTree: false,
18
+ cliExplicitPrompt: false,
19
+ allowFileCreate: false,
20
+ allowFileDelete: false,
21
+ allowDirectoryCreate: false,
22
+ allowFileMove: false,
23
+ verbosePrompt: false,
24
+ imagen: false,
25
+ vision: false,
26
+ }));
27
+ vi.mock('./limits.js');
28
+ describe('getCodeGenPrompt', () => {
29
+ beforeEach(() => {
30
+ vi.resetAllMocks();
31
+ });
32
+ it('should generate prompt for all files when considerAllFiles is true', () => {
33
+ vi.spyOn(findFiles, 'getSourceFiles').mockReturnValue(['file1.js', 'file2.js']);
34
+ vi.mocked(cliParams).considerAllFiles = true;
35
+ vi.mocked(cliParams).explicitPrompt = undefined;
36
+ vi.mocked(cliParams).allowFileCreate = false;
37
+ vi.mocked(cliParams).allowFileDelete = false;
38
+ vi.mocked(cliParams).allowDirectoryCreate = false;
39
+ vi.mocked(cliParams).allowFileMove = false;
40
+ vi.spyOn(limits, 'verifyCodegenPromptLimit').mockImplementation(() => { });
41
+ const prompt = getCodeGenPrompt({
42
+ considerAllFiles: true,
43
+ aiService: 'vertex-ai',
44
+ temperature: 0.7,
45
+ cheap: false,
46
+ }).prompt;
47
+ expect(prompt).toContain('You are allowed to modify all files in the application');
48
+ expect(prompt).toContain('Do not create new files.');
49
+ expect(prompt).toContain('Do not delete files.');
50
+ expect(prompt).toContain('Do not create new directories.');
51
+ expect(prompt).toContain('Do not move files.');
52
+ });
53
+ // Add more test cases for getCodeGenPrompt as needed
54
+ });
55
+ describe('getLintFixPrompt', () => {
56
+ beforeEach(() => {
57
+ vi.mocked(cliParams).verbosePrompt = false;
58
+ vi.spyOn(limits, 'verifyCodegenPromptLimit').mockImplementation(() => { });
59
+ });
60
+ it('should generate a lint fix prompt with provided command, stdout, and stderr', () => {
61
+ const command = 'eslint --fix';
62
+ const stdout = 'Fixed 2 errors';
63
+ const stderr = '';
64
+ const prompt = getLintFixPrompt(command, { aiService: 'vertex-ai' }, stdout, stderr);
65
+ expect(prompt).toContain('The following lint errors were encountered after the initial code generation:');
66
+ expect(prompt).toContain(`Lint command: ${command}`);
67
+ expect(prompt).toContain('Lint command stdout:');
68
+ expect(prompt).toContain(stdout);
69
+ expect(prompt).toContain('Lint command stderr:');
70
+ expect(prompt).toContain('Please suggest changes to fix these lint errors.');
71
+ });
72
+ it('should include stderr in the prompt when provided', () => {
73
+ const command = 'eslint --fix';
74
+ const stdout = '';
75
+ const stderr = 'Error: Unable to resolve path';
76
+ const prompt = getLintFixPrompt(command, { aiService: 'vertex-ai' }, stdout, stderr);
77
+ expect(prompt).toContain('Lint command stderr:');
78
+ expect(prompt).toContain(stderr);
79
+ });
80
+ it('should call verifyCodegenPromptLimit with the generated prompt', () => {
81
+ const command = 'eslint --fix';
82
+ const stdout = 'Fixed 1 error';
83
+ const stderr = '';
84
+ getLintFixPrompt(command, { aiService: 'vertex-ai' }, stdout, stderr);
85
+ expect(limits.verifyCodegenPromptLimit).toHaveBeenCalledWith(expect.any(String));
86
+ });
87
+ it('should log the prompt when verbosePrompt is true', () => {
88
+ const consoleSpy = vi.spyOn(console, 'log').mockImplementation(() => { });
89
+ const command = 'eslint --fix';
90
+ const stdout = 'Fixed 1 error';
91
+ const stderr = '';
92
+ getLintFixPrompt(command, { aiService: 'vertex-ai', verbose: true }, stdout, stderr);
93
+ expect(consoleSpy).toHaveBeenCalledWith('Lint fix prompt:');
94
+ expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining('The following lint errors were encountered'));
95
+ consoleSpy.mockRestore();
96
+ });
97
+ });
98
+ //# sourceMappingURL=prompt-codegen.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-codegen.test.js","sourceRoot":"","sources":["../../src/prompt/prompt-codegen.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE;CACxB,CAAC,CAAC,CAAC;AACJ,EAAE,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACvC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;CAC1B,CAAC,CAAC,CAAC;AACJ,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,mBAAmB,EAAE,KAAK;IAC1B,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,KAAK;IACxB,eAAe,EAAE,KAAK;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/B,MAAM,MAAM,GAAG,eAAe,CAAC;QAC/B,MAAM,MAAM,GAAG,EAAE,CAAC;QAElB,gBAAgB,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAErF,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,4CAA4C,CAAC,CAAC,CAAC;QAE/G,UAAU,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const CODEGEN_TRIGGER: string;
@@ -1 +1,2 @@
1
1
  export const CODEGEN_TRIGGER = '@' + 'CODEGEN';
2
+ //# sourceMappingURL=prompt-consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-consts.js","sourceRoot":"","sources":["../../src/prompt/prompt-consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAW,GAAG,GAAG,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import '../cli/cli-params.js';
2
+ import '../files/read-files.js';
3
+ import '../files/find-files.js';