genaicode 0.5.1 → 0.6.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 (627) hide show
  1. package/README.md +7 -11
  2. package/dist/ai-service/anthropic.js +7 -2
  3. package/dist/ai-service/anthropic.js.map +1 -1
  4. package/dist/ai-service/chat-gpt.d.ts +2 -0
  5. package/dist/ai-service/chat-gpt.js +7 -4
  6. package/dist/ai-service/chat-gpt.js.map +1 -1
  7. package/dist/ai-service/common.test.js +2 -1
  8. package/dist/ai-service/common.test.js.map +1 -1
  9. package/dist/ai-service/dall-e.js +1 -0
  10. package/dist/ai-service/dall-e.js.map +1 -1
  11. package/dist/ai-service/vertex-ai-claude.js +1 -0
  12. package/dist/ai-service/vertex-ai-claude.js.map +1 -1
  13. package/dist/cli/cli-options.js +10 -22
  14. package/dist/cli/cli-options.js.map +1 -1
  15. package/dist/cli/cli-params.d.ts +1 -5
  16. package/dist/cli/cli-params.js +10 -29
  17. package/dist/cli/cli-params.js.map +1 -1
  18. package/dist/cli/validate-cli-params.js +16 -11
  19. package/dist/cli/validate-cli-params.js.map +1 -1
  20. package/dist/cli/validate-cli-params.test.js +2 -2
  21. package/dist/cli/validate-cli-params.test.js.map +1 -1
  22. package/dist/examples/genaicode_plugins/fake_ai_service.d.ts +3 -0
  23. package/dist/examples/genaicode_plugins/fake_ai_service.js +11 -0
  24. package/dist/examples/genaicode_plugins/fake_ai_service.js.map +1 -0
  25. package/dist/examples/genaicode_plugins/grok_ai_service.d.ts +3 -0
  26. package/dist/examples/genaicode_plugins/grok_ai_service.js +153 -0
  27. package/dist/examples/genaicode_plugins/grok_ai_service.js.map +1 -0
  28. package/dist/examples/genaicode_plugins/nonsense_operation.d.ts +3 -0
  29. package/dist/examples/genaicode_plugins/nonsense_operation.js +23 -0
  30. package/dist/examples/genaicode_plugins/nonsense_operation.js.map +1 -0
  31. package/dist/files/path-utils.d.ts +1 -0
  32. package/dist/files/path-utils.js +12 -0
  33. package/dist/files/path-utils.js.map +1 -0
  34. package/dist/files/update-files.d.ts +1 -1
  35. package/dist/files/update-files.js +8 -183
  36. package/dist/files/update-files.js.map +1 -1
  37. package/dist/index.d.ts +6 -1
  38. package/dist/index.js +6 -0
  39. package/dist/index.js.map +1 -1
  40. package/dist/main/codegen-types.d.ts +31 -1
  41. package/dist/main/codegen-utils.d.ts +3 -0
  42. package/dist/main/codegen-utils.js +16 -0
  43. package/dist/main/codegen-utils.js.map +1 -0
  44. package/dist/main/codegen.js +15 -26
  45. package/dist/main/codegen.js.map +1 -1
  46. package/dist/main/codegen.test.js +12 -15
  47. package/dist/main/codegen.test.js.map +1 -1
  48. package/dist/main/common/user-actions.d.ts +14 -2
  49. package/dist/main/common/user-actions.js +16 -1
  50. package/dist/main/common/user-actions.js.map +1 -1
  51. package/dist/main/config-lib.d.ts +1 -0
  52. package/dist/main/config-lib.js +7 -0
  53. package/dist/main/config-lib.js.map +1 -1
  54. package/dist/main/config.js +3 -0
  55. package/dist/main/config.js.map +1 -1
  56. package/dist/main/interactive/user-action-handlers.js +2 -2
  57. package/dist/main/interactive/user-action-handlers.js.map +1 -1
  58. package/dist/main/plugin-loader.d.ts +9 -0
  59. package/dist/main/plugin-loader.js +55 -0
  60. package/dist/main/plugin-loader.js.map +1 -0
  61. package/dist/main/ui/backend/api-utils.js +2 -2
  62. package/dist/main/ui/backend/api-utils.js.map +1 -1
  63. package/dist/main/ui/backend/api.js +15 -3
  64. package/dist/main/ui/backend/api.js.map +1 -1
  65. package/dist/main/ui/backend/service.d.ts +6 -11
  66. package/dist/main/ui/backend/service.js +11 -7
  67. package/dist/main/ui/backend/service.js.map +1 -1
  68. package/dist/main/ui/common/api-types.d.ts +20 -0
  69. package/dist/main/ui/common/api-types.js +2 -0
  70. package/dist/main/ui/common/api-types.js.map +1 -0
  71. package/dist/main/ui/frontend/assets/{index-Dicb_1yw.js → index-Dk_qaEQg.js} +75 -72
  72. package/dist/main/ui/frontend/index.html +1 -1
  73. package/dist/main/ui/user-action-handlers.js +9 -4
  74. package/dist/main/ui/user-action-handlers.js.map +1 -1
  75. package/dist/operations/create-directory/create-directory-def.d.ts +9 -0
  76. package/dist/operations/create-directory/create-directory-def.js +22 -0
  77. package/dist/operations/create-directory/create-directory-def.js.map +1 -0
  78. package/dist/operations/create-directory/create-directory-executor.d.ts +6 -0
  79. package/dist/operations/create-directory/create-directory-executor.js +22 -0
  80. package/dist/operations/create-directory/create-directory-executor.js.map +1 -0
  81. package/dist/operations/create-file/create-file-def.d.ts +10 -0
  82. package/dist/operations/create-file/create-file-def.js +26 -0
  83. package/dist/operations/create-file/create-file-def.js.map +1 -0
  84. package/dist/operations/create-file/create-file-executor.d.ts +6 -0
  85. package/dist/operations/create-file/create-file-executor.js +27 -0
  86. package/dist/operations/create-file/create-file-executor.js.map +1 -0
  87. package/dist/operations/delete-file/delete-file-def.d.ts +9 -0
  88. package/dist/operations/delete-file/delete-file-def.js +22 -0
  89. package/dist/operations/delete-file/delete-file-def.js.map +1 -0
  90. package/dist/operations/delete-file/delete-file-executor.d.ts +6 -0
  91. package/dist/operations/delete-file/delete-file-executor.js +23 -0
  92. package/dist/operations/delete-file/delete-file-executor.js.map +1 -0
  93. package/dist/operations/download-file/download-file-def.d.ts +10 -0
  94. package/dist/operations/download-file/download-file-def.js +26 -0
  95. package/dist/operations/download-file/download-file-def.js.map +1 -0
  96. package/dist/operations/download-file/download-file-executor.d.ts +6 -0
  97. package/dist/operations/download-file/download-file-executor.js +44 -0
  98. package/dist/operations/download-file/download-file-executor.js.map +1 -0
  99. package/dist/operations/imgly-remove-background/imgly-remove-background-def.d.ts +10 -0
  100. package/dist/operations/imgly-remove-background/imgly-remove-background-def.js +26 -0
  101. package/dist/operations/imgly-remove-background/imgly-remove-background-def.js.map +1 -0
  102. package/dist/operations/imgly-remove-background/imgly-remove-background-executor.d.ts +6 -0
  103. package/dist/operations/imgly-remove-background/imgly-remove-background-executor.js +40 -0
  104. package/dist/operations/imgly-remove-background/imgly-remove-background-executor.js.map +1 -0
  105. package/dist/operations/move-file/move-file-def.d.ts +10 -0
  106. package/dist/operations/move-file/move-file-def.js +26 -0
  107. package/dist/operations/move-file/move-file-def.js.map +1 -0
  108. package/dist/operations/move-file/move-file-executor.d.ts +6 -0
  109. package/dist/operations/move-file/move-file-executor.js +29 -0
  110. package/dist/operations/move-file/move-file-executor.js.map +1 -0
  111. package/dist/operations/operations-index.d.ts +3 -0
  112. package/dist/operations/operations-index.js +33 -0
  113. package/dist/operations/operations-index.js.map +1 -0
  114. package/dist/operations/patch-file/patch-file-def.d.ts +10 -0
  115. package/dist/operations/patch-file/patch-file-def.js +39 -0
  116. package/dist/operations/patch-file/patch-file-def.js.map +1 -0
  117. package/dist/operations/patch-file/patch-file-executor.d.ts +5 -0
  118. package/dist/operations/patch-file/patch-file-executor.js +26 -0
  119. package/dist/operations/patch-file/patch-file-executor.js.map +1 -0
  120. package/dist/operations/resize-image/resize-image-def.d.ts +13 -0
  121. package/dist/operations/resize-image/resize-image-def.js +37 -0
  122. package/dist/operations/resize-image/resize-image-def.js.map +1 -0
  123. package/dist/operations/resize-image/resize-image-executor.d.ts +5 -0
  124. package/dist/operations/resize-image/resize-image-executor.js +30 -0
  125. package/dist/operations/resize-image/resize-image-executor.js.map +1 -0
  126. package/dist/operations/split-image/split-image-def.d.ts +18 -0
  127. package/dist/operations/split-image/split-image-def.js +46 -0
  128. package/dist/operations/split-image/split-image-def.js.map +1 -0
  129. package/dist/operations/split-image/split-image-executor.d.ts +6 -0
  130. package/dist/operations/split-image/split-image-executor.js +51 -0
  131. package/dist/operations/split-image/split-image-executor.js.map +1 -0
  132. package/dist/operations/update-file/update-file-def.d.ts +10 -0
  133. package/dist/operations/update-file/update-file-def.js +26 -0
  134. package/dist/operations/update-file/update-file-def.js.map +1 -0
  135. package/dist/operations/update-file/update-file-executor.d.ts +5 -0
  136. package/dist/operations/update-file/update-file-executor.js +22 -0
  137. package/dist/operations/update-file/update-file-executor.js.map +1 -0
  138. package/dist/prompt/ai-service-fallback.js.map +1 -1
  139. package/dist/prompt/function-calling-validate.js +2 -2
  140. package/dist/prompt/function-calling-validate.js.map +1 -1
  141. package/dist/prompt/function-calling.d.ts +1 -1
  142. package/dist/prompt/function-calling.js +29 -44
  143. package/dist/prompt/function-calling.js.map +1 -1
  144. package/dist/prompt/function-defs/ask-question-reflect.d.ts +2 -20
  145. package/dist/prompt/function-defs/ask-question-reflect.js.map +1 -1
  146. package/dist/prompt/function-defs/ask-question.d.ts +2 -73
  147. package/dist/prompt/function-defs/ask-question.js +28 -14
  148. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  149. package/dist/prompt/function-defs/codegen-summary.d.ts +2 -62
  150. package/dist/prompt/function-defs/codegen-summary.js +4 -2
  151. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  152. package/dist/prompt/function-defs/explanation.d.ts +2 -14
  153. package/dist/prompt/function-defs/explanation.js.map +1 -1
  154. package/dist/prompt/function-defs/generate-image.d.ts +2 -38
  155. package/dist/prompt/function-defs/generate-image.js.map +1 -1
  156. package/dist/prompt/function-defs/get-image-assets.d.ts +2 -17
  157. package/dist/prompt/function-defs/get-image-assets.js.map +1 -1
  158. package/dist/prompt/function-defs/get-source-code.d.ts +2 -17
  159. package/dist/prompt/function-defs/get-source-code.js.map +1 -1
  160. package/dist/prompt/function-defs/optimize-context.d.ts +2 -43
  161. package/dist/prompt/function-defs/optimize-context.js.map +1 -1
  162. package/dist/prompt/function-defs/read-history.d.ts +2 -13
  163. package/dist/prompt/function-defs/read-history.js.map +1 -1
  164. package/dist/prompt/function-defs/set-summaries.d.ts +2 -28
  165. package/dist/prompt/function-defs/set-summaries.js.map +1 -1
  166. package/dist/prompt/function-defs/update-history.d.ts +2 -18
  167. package/dist/prompt/function-defs/update-history.js.map +1 -1
  168. package/dist/prompt/prompt-service.js +6 -6
  169. package/dist/prompt/prompt-service.js.map +1 -1
  170. package/dist/prompt/prompt-service.test.js +16 -19
  171. package/dist/prompt/prompt-service.test.js.map +1 -1
  172. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +2 -0
  173. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +16 -0
  174. package/dist/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +1 -0
  175. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +2 -0
  176. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +37 -0
  177. package/dist/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -0
  178. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +2 -0
  179. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js +36 -0
  180. package/dist/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -0
  181. package/dist/prompt/steps/step-ask-question/handlers/default-action.d.ts +2 -0
  182. package/dist/prompt/steps/step-ask-question/handlers/default-action.js +18 -0
  183. package/dist/prompt/steps/step-ask-question/handlers/default-action.js.map +1 -0
  184. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +2 -0
  185. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js +20 -0
  186. package/dist/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +1 -0
  187. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +2 -0
  188. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +43 -0
  189. package/dist/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -0
  190. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +2 -0
  191. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js +49 -0
  192. package/dist/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -0
  193. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +2 -0
  194. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js +46 -0
  195. package/dist/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -0
  196. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +2 -0
  197. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js +16 -0
  198. package/dist/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +1 -0
  199. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  200. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js +2 -0
  201. package/dist/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +1 -0
  202. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +4 -0
  203. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js +91 -0
  204. package/dist/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +1 -0
  205. package/dist/prompt/steps/step-ask-question/step-ask-question-types.d.ts +56 -0
  206. package/dist/prompt/steps/step-ask-question/step-ask-question-types.js +2 -0
  207. package/dist/prompt/steps/step-ask-question/step-ask-question-types.js.map +1 -0
  208. package/dist/prompt/steps/step-ask-question/step-ask-question.d.ts +6 -0
  209. package/dist/prompt/steps/step-ask-question/step-ask-question.js +95 -0
  210. package/dist/prompt/steps/step-ask-question/step-ask-question.js.map +1 -0
  211. package/dist/prompt/steps/step-context-optimization.js +9 -2
  212. package/dist/prompt/steps/step-context-optimization.js.map +1 -1
  213. package/dist/prompt/steps/step-generate-summary.js +2 -2
  214. package/dist/prompt/steps/step-generate-summary.js.map +1 -1
  215. package/dist/prompt/steps/step-history-update.js +2 -2
  216. package/dist/prompt/steps/step-history-update.js.map +1 -1
  217. package/dist/prompt/steps/step-summarization.js +2 -2
  218. package/dist/prompt/steps/step-summarization.js.map +1 -1
  219. package/dist/src/ai-service/ai-studio.d.ts +6 -0
  220. package/dist/src/ai-service/ai-studio.js +190 -0
  221. package/dist/src/ai-service/ai-studio.js.map +1 -0
  222. package/dist/src/ai-service/anthropic.d.ts +6 -0
  223. package/dist/src/ai-service/anthropic.js +150 -0
  224. package/dist/src/ai-service/anthropic.js.map +1 -0
  225. package/dist/src/ai-service/chat-gpt.d.ts +5 -0
  226. package/dist/src/ai-service/chat-gpt.js +146 -0
  227. package/dist/src/ai-service/chat-gpt.js.map +1 -0
  228. package/dist/src/ai-service/common.d.ts +69 -0
  229. package/dist/src/ai-service/common.js +38 -0
  230. package/dist/src/ai-service/common.js.map +1 -0
  231. package/dist/src/ai-service/common.test.d.ts +1 -0
  232. package/dist/src/ai-service/common.test.js +86 -0
  233. package/dist/src/ai-service/common.test.js.map +1 -0
  234. package/dist/src/ai-service/dall-e.d.ts +14 -0
  235. package/dist/src/ai-service/dall-e.js +50 -0
  236. package/dist/src/ai-service/dall-e.js.map +1 -0
  237. package/dist/src/ai-service/unescape-function-call.d.ts +7 -0
  238. package/dist/src/ai-service/unescape-function-call.js +59 -0
  239. package/dist/src/ai-service/unescape-function-call.js.map +1 -0
  240. package/dist/src/ai-service/unescape-function-call.test.d.ts +1 -0
  241. package/dist/src/ai-service/unescape-function-call.test.js +18 -0
  242. package/dist/src/ai-service/unescape-function-call.test.js.map +1 -0
  243. package/dist/src/ai-service/vertex-ai-claude.d.ts +5 -0
  244. package/dist/src/ai-service/vertex-ai-claude.js +104 -0
  245. package/dist/src/ai-service/vertex-ai-claude.js.map +1 -0
  246. package/dist/src/ai-service/vertex-ai-imagen.d.ts +14 -0
  247. package/dist/src/ai-service/vertex-ai-imagen.js +77 -0
  248. package/dist/src/ai-service/vertex-ai-imagen.js.map +1 -0
  249. package/dist/src/ai-service/vertex-ai.d.ts +6 -0
  250. package/dist/src/ai-service/vertex-ai.js +202 -0
  251. package/dist/src/ai-service/vertex-ai.js.map +1 -0
  252. package/dist/src/cli/cli-options.d.ts +10 -0
  253. package/dist/src/cli/cli-options.js +132 -0
  254. package/dist/src/cli/cli-options.js.map +1 -0
  255. package/dist/src/cli/cli-options.test.d.ts +1 -0
  256. package/dist/src/cli/cli-options.test.js +34 -0
  257. package/dist/src/cli/cli-options.test.js.map +1 -0
  258. package/dist/src/cli/cli-params.d.ts +32 -0
  259. package/dist/src/cli/cli-params.js +106 -0
  260. package/dist/src/cli/cli-params.js.map +1 -0
  261. package/dist/src/cli/cli-params.test.d.ts +1 -0
  262. package/dist/src/cli/cli-params.test.js +38 -0
  263. package/dist/src/cli/cli-params.test.js.map +1 -0
  264. package/dist/src/cli/service-autodetect.d.ts +2 -0
  265. package/dist/src/cli/service-autodetect.js +17 -0
  266. package/dist/src/cli/service-autodetect.js.map +1 -0
  267. package/dist/src/cli/service-autodetect.test.d.ts +1 -0
  268. package/dist/src/cli/service-autodetect.test.js +38 -0
  269. package/dist/src/cli/service-autodetect.test.js.map +1 -0
  270. package/dist/src/cli/validate-cli-params.d.ts +18 -0
  271. package/dist/src/cli/validate-cli-params.js +145 -0
  272. package/dist/src/cli/validate-cli-params.js.map +1 -0
  273. package/dist/src/cli/validate-cli-params.test.d.ts +1 -0
  274. package/dist/src/cli/validate-cli-params.test.js +106 -0
  275. package/dist/src/cli/validate-cli-params.test.js.map +1 -0
  276. package/dist/src/files/cache-file.d.ts +3 -0
  277. package/dist/src/files/cache-file.js +36 -0
  278. package/dist/src/files/cache-file.js.map +1 -0
  279. package/dist/src/files/file-utils.d.ts +2 -0
  280. package/dist/src/files/file-utils.js +7 -0
  281. package/dist/src/files/file-utils.js.map +1 -0
  282. package/dist/src/files/file-utils.test.d.ts +1 -0
  283. package/dist/src/files/file-utils.test.js +18 -0
  284. package/dist/src/files/file-utils.test.js.map +1 -0
  285. package/dist/src/files/find-files.d.ts +9 -0
  286. package/dist/src/files/find-files.js +81 -0
  287. package/dist/src/files/find-files.js.map +1 -0
  288. package/dist/src/files/path-utils.d.ts +1 -0
  289. package/dist/src/files/path-utils.js +12 -0
  290. package/dist/src/files/path-utils.js.map +1 -0
  291. package/dist/src/files/read-files.d.ts +21 -0
  292. package/dist/src/files/read-files.js +68 -0
  293. package/dist/src/files/read-files.js.map +1 -0
  294. package/dist/src/files/read-files.test.d.ts +1 -0
  295. package/dist/src/files/read-files.test.js +89 -0
  296. package/dist/src/files/read-files.test.js.map +1 -0
  297. package/dist/src/files/temp-buffer.d.ts +2 -0
  298. package/dist/src/files/temp-buffer.js +12 -0
  299. package/dist/src/files/temp-buffer.js.map +1 -0
  300. package/dist/src/files/update-files.d.ts +6 -0
  301. package/dist/src/files/update-files.js +19 -0
  302. package/dist/src/files/update-files.js.map +1 -0
  303. package/dist/src/images/ensure-alpha.d.ts +1 -0
  304. package/dist/src/images/ensure-alpha.js +5 -0
  305. package/dist/src/images/ensure-alpha.js.map +1 -0
  306. package/dist/src/images/imgly-remove-background.d.ts +2 -0
  307. package/dist/src/images/imgly-remove-background.js +21 -0
  308. package/dist/src/images/imgly-remove-background.js.map +1 -0
  309. package/dist/src/images/resize-image.d.ts +19 -0
  310. package/dist/src/images/resize-image.js +22 -0
  311. package/dist/src/images/resize-image.js.map +1 -0
  312. package/dist/src/images/split-image.d.ts +18 -0
  313. package/dist/src/images/split-image.js +25 -0
  314. package/dist/src/images/split-image.js.map +1 -0
  315. package/dist/src/index.d.ts +3 -0
  316. package/dist/src/index.js +3 -0
  317. package/dist/src/index.js.map +1 -0
  318. package/dist/src/main/codegen-types.d.ts +58 -0
  319. package/dist/src/main/codegen-types.js +2 -0
  320. package/dist/src/main/codegen-types.js.map +1 -0
  321. package/dist/src/main/codegen-utils.d.ts +3 -0
  322. package/dist/src/main/codegen-utils.js +18 -0
  323. package/dist/src/main/codegen-utils.js.map +1 -0
  324. package/dist/src/main/codegen.d.ts +4 -0
  325. package/dist/src/main/codegen.js +201 -0
  326. package/dist/src/main/codegen.js.map +1 -0
  327. package/dist/src/main/codegen.test.d.ts +3 -0
  328. package/dist/src/main/codegen.test.js +288 -0
  329. package/dist/src/main/codegen.test.js.map +1 -0
  330. package/dist/src/main/common/content-bus-types.d.ts +21 -0
  331. package/dist/src/main/common/content-bus-types.js +11 -0
  332. package/dist/src/main/common/content-bus-types.js.map +1 -0
  333. package/dist/src/main/common/content-bus.d.ts +10 -0
  334. package/dist/src/main/common/content-bus.js +39 -0
  335. package/dist/src/main/common/content-bus.js.map +1 -0
  336. package/dist/src/main/common/cost-collector.d.ts +11 -0
  337. package/dist/src/main/common/cost-collector.js +90 -0
  338. package/dist/src/main/common/cost-collector.js.map +1 -0
  339. package/dist/src/main/common/user-actions.d.ts +19 -0
  340. package/dist/src/main/common/user-actions.js +30 -0
  341. package/dist/src/main/common/user-actions.js.map +1 -0
  342. package/dist/src/main/config-lib.d.ts +36 -0
  343. package/dist/src/main/config-lib.js +51 -0
  344. package/dist/src/main/config-lib.js.map +1 -0
  345. package/dist/src/main/config-lib.test.d.ts +1 -0
  346. package/dist/src/main/config-lib.test.js +64 -0
  347. package/dist/src/main/config-lib.test.js.map +1 -0
  348. package/dist/src/main/config.d.ts +7 -0
  349. package/dist/src/main/config.js +51 -0
  350. package/dist/src/main/config.js.map +1 -0
  351. package/dist/src/main/interactive/codegen-interactive.d.ts +2 -0
  352. package/dist/src/main/interactive/codegen-interactive.js +61 -0
  353. package/dist/src/main/interactive/codegen-interactive.js.map +1 -0
  354. package/dist/src/main/interactive/codegen-interactive.test.d.ts +5 -0
  355. package/dist/src/main/interactive/codegen-interactive.test.js +79 -0
  356. package/dist/src/main/interactive/codegen-interactive.test.js.map +1 -0
  357. package/dist/src/main/interactive/codegen-worker.d.ts +3 -0
  358. package/dist/src/main/interactive/codegen-worker.js +54 -0
  359. package/dist/src/main/interactive/codegen-worker.js.map +1 -0
  360. package/dist/src/main/interactive/common.d.ts +5 -0
  361. package/dist/src/main/interactive/common.js +51 -0
  362. package/dist/src/main/interactive/common.js.map +1 -0
  363. package/dist/src/main/interactive/configure.d.ts +2 -0
  364. package/dist/src/main/interactive/configure.js +99 -0
  365. package/dist/src/main/interactive/configure.js.map +1 -0
  366. package/dist/src/main/interactive/error-handling.d.ts +1 -0
  367. package/dist/src/main/interactive/error-handling.js +43 -0
  368. package/dist/src/main/interactive/error-handling.js.map +1 -0
  369. package/dist/src/main/interactive/help.d.ts +1 -0
  370. package/dist/src/main/interactive/help.js +22 -0
  371. package/dist/src/main/interactive/help.js.map +1 -0
  372. package/dist/src/main/interactive/process-comments.d.ts +2 -0
  373. package/dist/src/main/interactive/process-comments.js +39 -0
  374. package/dist/src/main/interactive/process-comments.js.map +1 -0
  375. package/dist/src/main/interactive/select-ai-service.d.ts +2 -0
  376. package/dist/src/main/interactive/select-ai-service.js +27 -0
  377. package/dist/src/main/interactive/select-ai-service.js.map +1 -0
  378. package/dist/src/main/interactive/task-file.d.ts +2 -0
  379. package/dist/src/main/interactive/task-file.js +35 -0
  380. package/dist/src/main/interactive/task-file.js.map +1 -0
  381. package/dist/src/main/interactive/text-prompt.d.ts +2 -0
  382. package/dist/src/main/interactive/text-prompt.js +18 -0
  383. package/dist/src/main/interactive/text-prompt.js.map +1 -0
  384. package/dist/src/main/interactive/user-action-handlers.d.ts +1 -0
  385. package/dist/src/main/interactive/user-action-handlers.js +13 -0
  386. package/dist/src/main/interactive/user-action-handlers.js.map +1 -0
  387. package/dist/src/main/interactive/user-interrupt.d.ts +1 -0
  388. package/dist/src/main/interactive/user-interrupt.js +36 -0
  389. package/dist/src/main/interactive/user-interrupt.js.map +1 -0
  390. package/dist/src/main/plugin-loader.d.ts +6 -0
  391. package/dist/src/main/plugin-loader.js +40 -0
  392. package/dist/src/main/plugin-loader.js.map +1 -0
  393. package/dist/src/main/ui/backend/api-utils.d.ts +2 -0
  394. package/dist/src/main/ui/backend/api-utils.js +18 -0
  395. package/dist/src/main/ui/backend/api-utils.js.map +1 -0
  396. package/dist/src/main/ui/backend/api.d.ts +2 -0
  397. package/dist/src/main/ui/backend/api.js +210 -0
  398. package/dist/src/main/ui/backend/api.js.map +1 -0
  399. package/dist/src/main/ui/backend/server.d.ts +7 -0
  400. package/dist/src/main/ui/backend/server.js +83 -0
  401. package/dist/src/main/ui/backend/server.js.map +1 -0
  402. package/dist/src/main/ui/backend/service.d.ts +44 -0
  403. package/dist/src/main/ui/backend/service.js +171 -0
  404. package/dist/src/main/ui/backend/service.js.map +1 -0
  405. package/dist/src/main/ui/codegen-ui.d.ts +2 -0
  406. package/dist/src/main/ui/codegen-ui.js +13 -0
  407. package/dist/src/main/ui/codegen-ui.js.map +1 -0
  408. package/dist/src/main/ui/common/api-types.d.ts +20 -0
  409. package/dist/src/main/ui/common/api-types.js +2 -0
  410. package/dist/src/main/ui/common/api-types.js.map +1 -0
  411. package/dist/src/main/ui/user-action-handlers.d.ts +2 -0
  412. package/dist/src/main/ui/user-action-handlers.js +14 -0
  413. package/dist/src/main/ui/user-action-handlers.js.map +1 -0
  414. package/dist/src/operations/create-directory/create-directory-def.d.ts +9 -0
  415. package/dist/src/operations/create-directory/create-directory-def.js +22 -0
  416. package/dist/src/operations/create-directory/create-directory-def.js.map +1 -0
  417. package/dist/src/operations/create-directory/create-directory-executor.d.ts +6 -0
  418. package/dist/src/operations/create-directory/create-directory-executor.js +22 -0
  419. package/dist/src/operations/create-directory/create-directory-executor.js.map +1 -0
  420. package/dist/src/operations/create-file/create-file-def.d.ts +10 -0
  421. package/dist/src/operations/create-file/create-file-def.js +26 -0
  422. package/dist/src/operations/create-file/create-file-def.js.map +1 -0
  423. package/dist/src/operations/create-file/create-file-executor.d.ts +6 -0
  424. package/dist/src/operations/create-file/create-file-executor.js +27 -0
  425. package/dist/src/operations/create-file/create-file-executor.js.map +1 -0
  426. package/dist/src/operations/delete-file/delete-file-def.d.ts +9 -0
  427. package/dist/src/operations/delete-file/delete-file-def.js +22 -0
  428. package/dist/src/operations/delete-file/delete-file-def.js.map +1 -0
  429. package/dist/src/operations/delete-file/delete-file-executor.d.ts +6 -0
  430. package/dist/src/operations/delete-file/delete-file-executor.js +23 -0
  431. package/dist/src/operations/delete-file/delete-file-executor.js.map +1 -0
  432. package/dist/src/operations/download-file/download-file-def.d.ts +10 -0
  433. package/dist/src/operations/download-file/download-file-def.js +26 -0
  434. package/dist/src/operations/download-file/download-file-def.js.map +1 -0
  435. package/dist/src/operations/download-file/download-file-executor.d.ts +6 -0
  436. package/dist/src/operations/download-file/download-file-executor.js +44 -0
  437. package/dist/src/operations/download-file/download-file-executor.js.map +1 -0
  438. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.d.ts +10 -0
  439. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js +26 -0
  440. package/dist/src/operations/imgly-remove-background/imgly-remove-background-def.js.map +1 -0
  441. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.d.ts +6 -0
  442. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js +40 -0
  443. package/dist/src/operations/imgly-remove-background/imgly-remove-background-executor.js.map +1 -0
  444. package/dist/src/operations/move-file/move-file-def.d.ts +10 -0
  445. package/dist/src/operations/move-file/move-file-def.js +26 -0
  446. package/dist/src/operations/move-file/move-file-def.js.map +1 -0
  447. package/dist/src/operations/move-file/move-file-executor.d.ts +6 -0
  448. package/dist/src/operations/move-file/move-file-executor.js +29 -0
  449. package/dist/src/operations/move-file/move-file-executor.js.map +1 -0
  450. package/dist/src/operations/operations-index.d.ts +3 -0
  451. package/dist/src/operations/operations-index.js +33 -0
  452. package/dist/src/operations/operations-index.js.map +1 -0
  453. package/dist/src/operations/patch-file/patch-file-def.d.ts +10 -0
  454. package/dist/src/operations/patch-file/patch-file-def.js +39 -0
  455. package/dist/src/operations/patch-file/patch-file-def.js.map +1 -0
  456. package/dist/src/operations/patch-file/patch-file-executor.d.ts +5 -0
  457. package/dist/src/operations/patch-file/patch-file-executor.js +26 -0
  458. package/dist/src/operations/patch-file/patch-file-executor.js.map +1 -0
  459. package/dist/src/operations/resize-image/resize-image-def.d.ts +13 -0
  460. package/dist/src/operations/resize-image/resize-image-def.js +37 -0
  461. package/dist/src/operations/resize-image/resize-image-def.js.map +1 -0
  462. package/dist/src/operations/resize-image/resize-image-executor.d.ts +5 -0
  463. package/dist/src/operations/resize-image/resize-image-executor.js +30 -0
  464. package/dist/src/operations/resize-image/resize-image-executor.js.map +1 -0
  465. package/dist/src/operations/split-image/split-image-def.d.ts +18 -0
  466. package/dist/src/operations/split-image/split-image-def.js +46 -0
  467. package/dist/src/operations/split-image/split-image-def.js.map +1 -0
  468. package/dist/src/operations/split-image/split-image-executor.d.ts +6 -0
  469. package/dist/src/operations/split-image/split-image-executor.js +51 -0
  470. package/dist/src/operations/split-image/split-image-executor.js.map +1 -0
  471. package/dist/src/operations/update-file/update-file-def.d.ts +10 -0
  472. package/dist/src/operations/update-file/update-file-def.js +26 -0
  473. package/dist/src/operations/update-file/update-file-def.js.map +1 -0
  474. package/dist/src/operations/update-file/update-file-executor.d.ts +5 -0
  475. package/dist/src/operations/update-file/update-file-executor.js +22 -0
  476. package/dist/src/operations/update-file/update-file-executor.js.map +1 -0
  477. package/dist/src/prompt/ai-service-fallback.d.ts +3 -0
  478. package/dist/src/prompt/ai-service-fallback.js +84 -0
  479. package/dist/src/prompt/ai-service-fallback.js.map +1 -0
  480. package/dist/src/prompt/function-calling-validate.d.ts +3 -0
  481. package/dist/src/prompt/function-calling-validate.js +99 -0
  482. package/dist/src/prompt/function-calling-validate.js.map +1 -0
  483. package/dist/src/prompt/function-calling.d.ts +5 -0
  484. package/dist/src/prompt/function-calling.js +43 -0
  485. package/dist/src/prompt/function-calling.js.map +1 -0
  486. package/dist/src/prompt/function-defs/ask-question-reflect.d.ts +2 -0
  487. package/dist/src/prompt/function-defs/ask-question-reflect.js +21 -0
  488. package/dist/src/prompt/function-defs/ask-question-reflect.js.map +1 -0
  489. package/dist/src/prompt/function-defs/ask-question.d.ts +8 -0
  490. package/dist/src/prompt/function-defs/ask-question.js +100 -0
  491. package/dist/src/prompt/function-defs/ask-question.js.map +1 -0
  492. package/dist/src/prompt/function-defs/codegen-summary.d.ts +5 -0
  493. package/dist/src/prompt/function-defs/codegen-summary.js +82 -0
  494. package/dist/src/prompt/function-defs/codegen-summary.js.map +1 -0
  495. package/dist/src/prompt/function-defs/explanation.d.ts +5 -0
  496. package/dist/src/prompt/function-defs/explanation.js +18 -0
  497. package/dist/src/prompt/function-defs/explanation.js.map +1 -0
  498. package/dist/src/prompt/function-defs/generate-image.d.ts +5 -0
  499. package/dist/src/prompt/function-defs/generate-image.js +42 -0
  500. package/dist/src/prompt/function-defs/generate-image.js.map +1 -0
  501. package/dist/src/prompt/function-defs/get-image-assets.d.ts +5 -0
  502. package/dist/src/prompt/function-defs/get-image-assets.js +21 -0
  503. package/dist/src/prompt/function-defs/get-image-assets.js.map +1 -0
  504. package/dist/src/prompt/function-defs/get-source-code.d.ts +5 -0
  505. package/dist/src/prompt/function-defs/get-source-code.js +22 -0
  506. package/dist/src/prompt/function-defs/get-source-code.js.map +1 -0
  507. package/dist/src/prompt/function-defs/optimize-context.d.ts +5 -0
  508. package/dist/src/prompt/function-defs/optimize-context.js +47 -0
  509. package/dist/src/prompt/function-defs/optimize-context.js.map +1 -0
  510. package/dist/src/prompt/function-defs/read-history.d.ts +2 -0
  511. package/dist/src/prompt/function-defs/read-history.js +14 -0
  512. package/dist/src/prompt/function-defs/read-history.js.map +1 -0
  513. package/dist/src/prompt/function-defs/set-summaries.d.ts +5 -0
  514. package/dist/src/prompt/function-defs/set-summaries.js +32 -0
  515. package/dist/src/prompt/function-defs/set-summaries.js.map +1 -0
  516. package/dist/src/prompt/function-defs/update-history.d.ts +5 -0
  517. package/dist/src/prompt/function-defs/update-history.js +22 -0
  518. package/dist/src/prompt/function-defs/update-history.js.map +1 -0
  519. package/dist/src/prompt/limits.d.ts +3 -0
  520. package/dist/src/prompt/limits.js +21 -0
  521. package/dist/src/prompt/limits.js.map +1 -0
  522. package/dist/src/prompt/limits.test.d.ts +1 -0
  523. package/dist/src/prompt/limits.test.js +35 -0
  524. package/dist/src/prompt/limits.test.js.map +1 -0
  525. package/dist/src/prompt/prompt-codegen.d.ts +9 -0
  526. package/dist/src/prompt/prompt-codegen.js +117 -0
  527. package/dist/src/prompt/prompt-codegen.js.map +1 -0
  528. package/dist/src/prompt/prompt-codegen.test.d.ts +1 -0
  529. package/dist/src/prompt/prompt-codegen.test.js +98 -0
  530. package/dist/src/prompt/prompt-codegen.test.js.map +1 -0
  531. package/dist/src/prompt/prompt-consts.d.ts +1 -0
  532. package/dist/src/prompt/prompt-consts.js +2 -0
  533. package/dist/src/prompt/prompt-consts.js.map +1 -0
  534. package/dist/src/prompt/prompt-service-ask-question.test.d.ts +4 -0
  535. package/dist/src/prompt/prompt-service-ask-question.test.js +215 -0
  536. package/dist/src/prompt/prompt-service-ask-question.test.js.map +1 -0
  537. package/dist/src/prompt/prompt-service.d.ts +5 -0
  538. package/dist/src/prompt/prompt-service.js +214 -0
  539. package/dist/src/prompt/prompt-service.js.map +1 -0
  540. package/dist/src/prompt/prompt-service.test.d.ts +2 -0
  541. package/dist/src/prompt/prompt-service.test.js +553 -0
  542. package/dist/src/prompt/prompt-service.test.js.map +1 -0
  543. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.d.ts +2 -0
  544. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js +16 -0
  545. package/dist/src/prompt/steps/step-ask-question/handlers/cancel-code-generation.js.map +1 -0
  546. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.d.ts +2 -0
  547. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js +37 -0
  548. package/dist/src/prompt/steps/step-ask-question/handlers/confirm-code-generation.js.map +1 -0
  549. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.d.ts +2 -0
  550. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js +36 -0
  551. package/dist/src/prompt/steps/step-ask-question/handlers/context-optimization.js.map +1 -0
  552. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.d.ts +2 -0
  553. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js +18 -0
  554. package/dist/src/prompt/steps/step-ask-question/handlers/default-action.js.map +1 -0
  555. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.d.ts +2 -0
  556. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js +20 -0
  557. package/dist/src/prompt/steps/step-ask-question/handlers/handle-request-answer.js.map +1 -0
  558. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.d.ts +2 -0
  559. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js +43 -0
  560. package/dist/src/prompt/steps/step-ask-question/handlers/remove-files-from-context.js.map +1 -0
  561. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.d.ts +2 -0
  562. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js +49 -0
  563. package/dist/src/prompt/steps/step-ask-question/handlers/request-files-content.js.map +1 -0
  564. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.d.ts +2 -0
  565. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js +46 -0
  566. package/dist/src/prompt/steps/step-ask-question/handlers/request-permissions.js.map +1 -0
  567. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.d.ts +2 -0
  568. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js +16 -0
  569. package/dist/src/prompt/steps/step-ask-question/handlers/start-code-generation.js.map +1 -0
  570. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.d.ts +0 -0
  571. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js +2 -0
  572. package/dist/src/prompt/steps/step-ask-question/step-ask-question-handlers.js.map +1 -0
  573. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.d.ts +4 -0
  574. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js +91 -0
  575. package/dist/src/prompt/steps/step-ask-question/step-ask-question-reflect.js.map +1 -0
  576. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.d.ts +55 -0
  577. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js +2 -0
  578. package/dist/src/prompt/steps/step-ask-question/step-ask-question-types.js.map +1 -0
  579. package/dist/src/prompt/steps/step-ask-question/step-ask-question.d.ts +6 -0
  580. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js +88 -0
  581. package/dist/src/prompt/steps/step-ask-question/step-ask-question.js.map +1 -0
  582. package/dist/src/prompt/steps/step-context-optimization.d.ts +4 -0
  583. package/dist/src/prompt/steps/step-context-optimization.js +200 -0
  584. package/dist/src/prompt/steps/step-context-optimization.js.map +1 -0
  585. package/dist/src/prompt/steps/step-generate-image.d.ts +2 -0
  586. package/dist/src/prompt/steps/step-generate-image.js +29 -0
  587. package/dist/src/prompt/steps/step-generate-image.js.map +1 -0
  588. package/dist/src/prompt/steps/step-generate-summary.d.ts +3 -0
  589. package/dist/src/prompt/steps/step-generate-summary.js +41 -0
  590. package/dist/src/prompt/steps/step-generate-summary.js.map +1 -0
  591. package/dist/src/prompt/steps/step-history-update.d.ts +5 -0
  592. package/dist/src/prompt/steps/step-history-update.js +54 -0
  593. package/dist/src/prompt/steps/step-history-update.js.map +1 -0
  594. package/dist/src/prompt/steps/step-summarization.d.ts +8 -0
  595. package/dist/src/prompt/steps/step-summarization.js +75 -0
  596. package/dist/src/prompt/steps/step-summarization.js.map +1 -0
  597. package/dist/src/prompt/steps/step-validate-recover.d.ts +2 -0
  598. package/dist/src/prompt/steps/step-validate-recover.js +51 -0
  599. package/dist/src/prompt/steps/step-validate-recover.js.map +1 -0
  600. package/dist/src/prompt/steps/step-verify-patch.d.ts +6 -0
  601. package/dist/src/prompt/steps/step-verify-patch.js +34 -0
  602. package/dist/src/prompt/steps/step-verify-patch.js.map +1 -0
  603. package/dist/src/prompt/steps/steps-types.d.ts +16 -0
  604. package/dist/src/prompt/steps/steps-types.js +6 -0
  605. package/dist/src/prompt/steps/steps-types.js.map +1 -0
  606. package/dist/src/prompt/steps/steps-utils.d.ts +7 -0
  607. package/dist/src/prompt/steps/steps-utils.js +11 -0
  608. package/dist/src/prompt/steps/steps-utils.js.map +1 -0
  609. package/dist/src/prompt/systemprompt.d.ts +3 -0
  610. package/dist/src/prompt/systemprompt.js +209 -0
  611. package/dist/src/prompt/systemprompt.js.map +1 -0
  612. package/dist/src/prompt/systemprompt.test.d.ts +3 -0
  613. package/dist/src/prompt/systemprompt.test.js +43 -0
  614. package/dist/src/prompt/systemprompt.test.js.map +1 -0
  615. package/dist/src/prompt/token-estimator.d.ts +8 -0
  616. package/dist/src/prompt/token-estimator.js +31 -0
  617. package/dist/src/prompt/token-estimator.js.map +1 -0
  618. package/dist/src/vite-genaicode/vite-genaicode-frontend.d.ts +1 -0
  619. package/dist/src/vite-genaicode/vite-genaicode-frontend.js +142 -0
  620. package/dist/src/vite-genaicode/vite-genaicode-frontend.js.map +1 -0
  621. package/dist/src/vite-genaicode/vite-genaicode-plugin.d.ts +7 -0
  622. package/dist/src/vite-genaicode/vite-genaicode-plugin.js +40 -0
  623. package/dist/src/vite-genaicode/vite-genaicode-plugin.js.map +1 -0
  624. package/dist/vite-genaicode/vite-genaicode-plugin.d.ts +2 -1
  625. package/dist/vite-genaicode/vite-genaicode-plugin.js +20 -5
  626. package/dist/vite-genaicode/vite-genaicode-plugin.js.map +1 -1
  627. package/package.json +6 -3
@@ -1,79 +1,8 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for askQuestion
3
4
  *
4
5
  * Use this function to ask questions, seek clarification, request file permissions, or manage the flow of the conversation.
5
6
  * Each actionType serves a specific purpose, ensuring clarity and proper task execution.
6
7
  */
7
- export declare const askQuestion: {
8
- readonly name: "askQuestion";
9
- readonly description: "Use this function to ask a question, seek clarification, or manage the flow of the conversation. For analysis requests, use actionType \"requestAnswer\". Only proceed to code generation when explicitly instructed or after confirmation.";
10
- readonly parameters: {
11
- readonly type: "object";
12
- readonly properties: {
13
- readonly actionType: {
14
- readonly type: "string";
15
- readonly enum: readonly ["requestAnswer", "requestPermissions", "requestFilesContent", "removeFilesFromContext", "confirmCodeGeneration", "startCodeGeneration", "cancelCodeGeneration", "contextOptimization"];
16
- readonly description: "This value instructs the program on what should happen next. Use \"requestAnswer\" for analysis requests or clarifications.,\n\n Detailed Explanation of actionTypes:\n - requestAnswer: Use for general information, clarifications, or when no specific code is needed.\n - requestPermissions: Use when additional permissions are required for actions like creating or deleting files.\n - requestFilesContent: Use specifically when needing to access or review the contents of files.\n - removeFilesFromContext: Use to remove unnecessary file contents from context, optimizing token usage.\n - confirmCodeGeneration: Use to confirm with the user before starting code generation tasks.\n - startCodeGeneration: Use only after receiving confirmation to begin code generation.\n - cancelCodeGeneration: Use if code generation should be stopped or canceled.\n - contextOptimization: Use to manage and optimize context during code generation tasks, allowing the LLM to provide guidance on what parts of the context are most relevant to keep.\n ";
17
- };
18
- readonly content: {
19
- readonly type: "string";
20
- readonly description: "The message you want to display to the user. It can be a question if you need more information, an analysis result, or a confirmation request before proceeding with code generation.";
21
- };
22
- readonly promptNecessity: {
23
- readonly type: "number";
24
- readonly minimum: 0;
25
- readonly maximum: 100;
26
- readonly description: "Indicates how strongly you need a response from the user. A higher value means a stronger need for user input.";
27
- };
28
- readonly requestFilesContent: {
29
- readonly type: "array";
30
- readonly description: "An array of absolute file paths for which you need the content. Use this when specific files are missing and you need them to proceed with the task.";
31
- readonly items: {
32
- readonly type: "string";
33
- };
34
- };
35
- readonly removeFilesFromContext: {
36
- readonly type: "array";
37
- readonly description: "An array of absolute file paths that should be removed from the context. Use this to optimize token usage by removing unnecessary file contents.";
38
- readonly items: {
39
- readonly type: "string";
40
- };
41
- };
42
- readonly contextOptimization: {
43
- readonly type: "string";
44
- readonly description: "A prompt generated to guide the LLM in optimizing context by specifying which parts of the context are most relevant to keep. This helps in efficient management during code generation tasks.";
45
- };
46
- readonly requestPermissions: {
47
- readonly type: "object";
48
- readonly description: "Use this to request additional permissions needed for code generation if they are not already granted.";
49
- readonly properties: {
50
- readonly allowDirectoryCreate: {
51
- readonly description: "Set to true to request permission for creating directories.";
52
- readonly type: "boolean";
53
- };
54
- readonly allowFileCreate: {
55
- readonly description: "Set to true to request permission for creating files.";
56
- readonly type: "boolean";
57
- };
58
- readonly allowFileDelete: {
59
- readonly description: "Set to true to request permission for deleting files.";
60
- readonly type: "boolean";
61
- };
62
- readonly allowFileMove: {
63
- readonly description: "Set to true to request permission for moving files.";
64
- readonly type: "boolean";
65
- };
66
- readonly enableVision: {
67
- readonly description: "Set to true to request permission for vision capabilities, using images as context for code generation.";
68
- readonly type: "boolean";
69
- };
70
- readonly enableImagen: {
71
- readonly description: "Set to true to request permission for generating images.";
72
- readonly type: "boolean";
73
- };
74
- };
75
- };
76
- };
77
- readonly required: readonly ["actionType", "content", "promptNecessity"];
78
- };
79
- };
8
+ export declare const getAskQuestionDef: () => FunctionDef;
@@ -1,10 +1,34 @@
1
+ import { getRegisteredActionHandlerDescriptions, getRegisteredActionHandlers } from '../../main/plugin-loader.js';
1
2
  /**
2
3
  * Function definition for askQuestion
3
4
  *
4
5
  * Use this function to ask questions, seek clarification, request file permissions, or manage the flow of the conversation.
5
6
  * Each actionType serves a specific purpose, ensuring clarity and proper task execution.
6
7
  */
7
- export const askQuestion = {
8
+ function getActionTypeDescription() {
9
+ const pluginDescriptions = Array.from(getRegisteredActionHandlerDescriptions().entries())
10
+ .map(([actionType, description]) => ` - ${actionType}: ${description}`)
11
+ .join('\n');
12
+ return `This value instructs the program on what should happen next. Use "requestAnswer" for analysis requests or clarifications.,
13
+
14
+ Detailed Explanation of actionTypes:
15
+ - requestAnswer: Use for general information, clarifications, or when no specific code is needed.
16
+ - requestPermissions: Use when additional permissions are required for actions like creating or deleting files.
17
+ - requestFilesContent: Use specifically when needing to access or review the contents of files.
18
+ - removeFilesFromContext: Use to remove unnecessary file contents from context, optimizing token usage.
19
+ - confirmCodeGeneration: Use to confirm with the user before starting code generation tasks.
20
+ - startCodeGeneration: Use only after receiving confirmation to begin code generation.
21
+ - cancelCodeGeneration: Use if code generation should be stopped or canceled.
22
+ - contextOptimization: Use to manage and optimize context during code generation tasks, allowing the LLM to provide guidance on what parts of the context are most relevant to keep.
23
+ ${pluginDescriptions}`;
24
+ }
25
+ /**
26
+ * Function definition for askQuestion
27
+ *
28
+ * Use this function to ask questions, seek clarification, request file permissions, or manage the flow of the conversation.
29
+ * Each actionType serves a specific purpose, ensuring clarity and proper task execution.
30
+ */
31
+ export const getAskQuestionDef = () => ({
8
32
  name: 'askQuestion',
9
33
  description: 'Use this function to ask a question, seek clarification, or manage the flow of the conversation. For analysis requests, use actionType "requestAnswer". Only proceed to code generation when explicitly instructed or after confirmation.',
10
34
  parameters: {
@@ -21,19 +45,9 @@ export const askQuestion = {
21
45
  'startCodeGeneration',
22
46
  'cancelCodeGeneration',
23
47
  'contextOptimization',
48
+ ...Array.from(getRegisteredActionHandlers().keys()),
24
49
  ],
25
- description: `This value instructs the program on what should happen next. Use "requestAnswer" for analysis requests or clarifications.,
26
-
27
- Detailed Explanation of actionTypes:
28
- - requestAnswer: Use for general information, clarifications, or when no specific code is needed.
29
- - requestPermissions: Use when additional permissions are required for actions like creating or deleting files.
30
- - requestFilesContent: Use specifically when needing to access or review the contents of files.
31
- - removeFilesFromContext: Use to remove unnecessary file contents from context, optimizing token usage.
32
- - confirmCodeGeneration: Use to confirm with the user before starting code generation tasks.
33
- - startCodeGeneration: Use only after receiving confirmation to begin code generation.
34
- - cancelCodeGeneration: Use if code generation should be stopped or canceled.
35
- - contextOptimization: Use to manage and optimize context during code generation tasks, allowing the LLM to provide guidance on what parts of the context are most relevant to keep.
36
- `,
50
+ description: getActionTypeDescription(),
37
51
  },
38
52
  content: {
39
53
  type: 'string',
@@ -96,5 +110,5 @@ export const askQuestion = {
96
110
  },
97
111
  required: ['actionType', 'content', 'promptNecessity'],
98
112
  },
99
- };
113
+ });
100
114
  //# sourceMappingURL=ask-question.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/ask-question.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,2OAA2O;IAC7O,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;oBACJ,eAAe;oBACf,oBAAoB;oBACpB,qBAAqB;oBACrB,wBAAwB;oBACxB,uBAAuB;oBACvB,qBAAqB;oBACrB,sBAAsB;oBACtB,qBAAqB;iBACtB;gBACD,WAAW,EAAE;;;;;;;;;;;SAWZ;aACF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uLAAuL;aAC1L;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;gBACZ,WAAW,EACT,gHAAgH;aACnH;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,sJAAsJ;gBACxJ,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,sBAAsB,EAAE;gBACtB,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,kJAAkJ;gBACpJ,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gMAAgM;aACnM;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wGAAwG;gBAC1G,UAAU,EAAE;oBACV,oBAAoB,EAAE;wBACpB,WAAW,EAAE,6DAA6D;wBAC1E,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,uDAAuD;wBACpE,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,uDAAuD;wBACpE,IAAI,EAAE,SAAS;qBAChB;oBACD,aAAa,EAAE;wBACb,WAAW,EAAE,qDAAqD;wBAClE,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EACT,yGAAyG;wBAC3G,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EAAE,0DAA0D;wBACvE,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,iBAAiB,CAAC;KACvD;CACO,CAAC"}
1
+ {"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/ask-question.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sCAAsC,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAElH;;;;;GAKG;AACH,SAAS,wBAAwB;IAC/B,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,sCAAsC,EAAE,CAAC,OAAO,EAAE,CAAC;SACtF,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,MAAM,UAAU,KAAK,WAAW,EAAE,CAAC;SACtE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO;;;;;;;;;;;EAWP,kBAAkB,EAAE,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAgB,EAAE,CAAC,CAAC;IACnD,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,2OAA2O;IAC7O,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;oBACJ,eAAe;oBACf,oBAAoB;oBACpB,qBAAqB;oBACrB,wBAAwB;oBACxB,uBAAuB;oBACvB,qBAAqB;oBACrB,sBAAsB;oBACtB,qBAAqB;oBACrB,GAAG,KAAK,CAAC,IAAI,CAAC,2BAA2B,EAAE,CAAC,IAAI,EAAE,CAAC;iBACpD;gBACD,WAAW,EAAE,wBAAwB,EAAE;aACxC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uLAAuL;aAC1L;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;gBACZ,WAAW,EACT,gHAAgH;aACnH;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,sJAAsJ;gBACxJ,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,sBAAsB,EAAE;gBACtB,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,kJAAkJ;gBACpJ,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gMAAgM;aACnM;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wGAAwG;gBAC1G,UAAU,EAAE;oBACV,oBAAoB,EAAE;wBACpB,WAAW,EAAE,6DAA6D;wBAC1E,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,uDAAuD;wBACpE,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,uDAAuD;wBACpE,IAAI,EAAE,SAAS;qBAChB;oBACD,aAAa,EAAE;wBACb,WAAW,EAAE,qDAAqD;wBAClE,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EACT,yGAAyG;wBAC3G,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EAAE,0DAA0D;wBACvE,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,iBAAiB,CAAC;KACvD;CACF,CAAC,CAAC"}
@@ -1,65 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common.js';
1
2
  /**
2
3
  * Function definition for codegenSummary
3
4
  */
4
- export declare const codegenSummary: {
5
- readonly name: "codegenSummary";
6
- readonly description: string;
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly explanation: {
11
- readonly type: "string";
12
- readonly description: "A brief description of the planned changes or an explanation if no changes are proposed.";
13
- };
14
- readonly fileUpdates: {
15
- readonly type: "array";
16
- readonly description: "An array of proposed file updates, each update is an object with several properties.";
17
- readonly items: {
18
- readonly type: "object";
19
- readonly description: "An object representing a proposed update to a file, containing properties like the absolute file path, the update tool name, and other important properties.";
20
- readonly properties: {
21
- readonly filePath: {
22
- readonly type: "string";
23
- readonly description: "An absolute path of the project file that will be updated. This must be an absolute file path.";
24
- };
25
- readonly prompt: {
26
- readonly type: "string";
27
- readonly description: "A detailed prompt that will be passed to the model request together with the tool request. It summarizes the planned changes for this particular file.";
28
- };
29
- readonly updateToolName: {
30
- readonly type: "string";
31
- readonly enum: readonly ["createFile", "updateFile", "patchFile", "deleteFile", "createDirectory", "moveFile", "generateImage", "downloadFile", "splitImage", "resizeImage", "imglyRemoveBackground"];
32
- readonly description: "The name of the tool that will be used to perform the update.";
33
- };
34
- readonly temperature: {
35
- readonly type: "number";
36
- readonly description: "Temperature parameter for the LLM request. Should be within the range [0.0, 2.0]. Lower values make the output more deterministic.";
37
- readonly minimum: 0;
38
- readonly maximum: 2;
39
- };
40
- readonly cheap: {
41
- readonly type: "boolean";
42
- readonly description: "If true, the prompt will be executed with a cheaper, faster model that provides lower quality results. Use only when lower quality results are acceptable.";
43
- };
44
- readonly contextImageAssets: {
45
- readonly type: "array";
46
- readonly description: "A list of absolute image asset paths that should be included in the context of the LLM request. Use this parameter when there is a need to analyze an image.";
47
- readonly items: {
48
- readonly type: "string";
49
- };
50
- };
51
- };
52
- readonly required: readonly ["filePath", "prompt", "updateToolName"];
53
- };
54
- };
55
- readonly contextPaths: {
56
- readonly type: "array";
57
- readonly description: "An array of absolute file paths that should be used to provide context for the following updates. These could be dependencies or files that depend on the files to be updated.";
58
- readonly items: {
59
- readonly type: "string";
60
- };
61
- };
62
- };
63
- readonly required: readonly ["explanation", "fileUpdates", "contextPaths"];
64
- };
65
- };
5
+ export declare const getCodegenSummaryDef: () => FunctionDef;
@@ -1,7 +1,8 @@
1
+ import { getRegisteredOperations } from '../../main/plugin-loader.js';
1
2
  /**
2
3
  * Function definition for codegenSummary
3
4
  */
4
- export const codegenSummary = {
5
+ export const getCodegenSummaryDef = () => ({
5
6
  name: 'codegenSummary',
6
7
  description: 'This function is called with a summary of proposed updates.\n' +
7
8
  '- `explanation`: A general explanation of the planned code generation updates or reasoning for no code changes.\n' +
@@ -44,6 +45,7 @@ export const codegenSummary = {
44
45
  'splitImage',
45
46
  'resizeImage',
46
47
  'imglyRemoveBackground',
48
+ ...getRegisteredOperations().map((operation) => operation.def.name),
47
49
  ],
48
50
  description: 'The name of the tool that will be used to perform the update.',
49
51
  },
@@ -76,5 +78,5 @@ export const codegenSummary = {
76
78
  },
77
79
  required: ['explanation', 'fileUpdates', 'contextPaths'],
78
80
  },
79
- };
81
+ });
80
82
  //# sourceMappingURL=codegen-summary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen-summary.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/codegen-summary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,+DAA+D;QAC/D,mHAAmH;QACnH,iHAAiH;QACjH,0GAA0G;QAC1G,mEAAmE;IACrE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0FAA0F;aACxG;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,sFAAsF;gBACnG,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,8JAA8J;oBAChK,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,gGAAgG;yBACnG;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,wJAAwJ;yBAC3J;wBACD,cAAc,EAAE;4BACd,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE;gCACJ,YAAY;gCACZ,YAAY;gCACZ,WAAW;gCACX,YAAY;gCACZ,iBAAiB;gCACjB,UAAU;gCACV,eAAe;gCACf,cAAc;gCACd,YAAY;gCACZ,aAAa;gCACb,uBAAuB;6BACxB;4BACD,WAAW,EAAE,+DAA+D;yBAC7E;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,oIAAoI;4BACtI,OAAO,EAAE,GAAG;4BACZ,OAAO,EAAE,GAAG;yBACb;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,SAAS;4BACf,WAAW,EACT,4JAA4J;yBAC/J;wBACD,kBAAkB,EAAE;4BAClB,IAAI,EAAE,OAAO;4BACb,WAAW,EACT,8JAA8J;4BAChK,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;yBAC1B;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,gBAAgB,CAAC;iBACnD;aACF;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,gLAAgL;gBAClL,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC;KACzD;CACO,CAAC"}
1
+ {"version":3,"file":"codegen-summary.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/codegen-summary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAgB,EAAE,CAAC,CAAC;IACtD,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,+DAA+D;QAC/D,mHAAmH;QACnH,iHAAiH;QACjH,0GAA0G;QAC1G,mEAAmE;IACrE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0FAA0F;aACxG;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,sFAAsF;gBACnG,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,8JAA8J;oBAChK,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,gGAAgG;yBACnG;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,wJAAwJ;yBAC3J;wBACD,cAAc,EAAE;4BACd,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE;gCACJ,YAAY;gCACZ,YAAY;gCACZ,WAAW;gCACX,YAAY;gCACZ,iBAAiB;gCACjB,UAAU;gCACV,eAAe;gCACf,cAAc;gCACd,YAAY;gCACZ,aAAa;gCACb,uBAAuB;gCACvB,GAAG,uBAAuB,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;6BACpE;4BACD,WAAW,EAAE,+DAA+D;yBAC7E;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,oIAAoI;4BACtI,OAAO,EAAE,GAAG;4BACZ,OAAO,EAAE,GAAG;yBACb;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,SAAS;4BACf,WAAW,EACT,4JAA4J;yBAC/J;wBACD,kBAAkB,EAAE;4BAClB,IAAI,EAAE,OAAO;4BACb,WAAW,EACT,8JAA8J;4BAChK,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;yBAC1B;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,gBAAgB,CAAC;iBACnD;aACF;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,gLAAgL;gBAClL,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC;KACzD;CACF,CAAC,CAAC"}
@@ -1,17 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for explanation
3
4
  */
4
- export declare const explanation: {
5
- readonly name: "explanation";
6
- readonly description: "Explain the reasoning behind the suggested code changes or reasoning for lack of code changes";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly text: {
11
- readonly type: "string";
12
- readonly description: "The explanation text";
13
- };
14
- };
15
- readonly required: readonly ["text"];
16
- };
17
- };
5
+ export declare const explanation: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"explanation.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/explanation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,+FAA+F;IAC5G,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;aACpC;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACO,CAAC"}
1
+ {"version":3,"file":"explanation.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/explanation.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,+FAA+F;IAC5G,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sBAAsB;aACpC;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB;CACF,CAAC"}
@@ -1,41 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for generateImage
3
4
  */
4
- export declare const generateImage: {
5
- readonly name: "generateImage";
6
- readonly description: "Generate an image using AI service and save it as a file.";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly explanation: {
11
- readonly type: "string";
12
- readonly description: "The explanation of the reasoning behind generating this image";
13
- };
14
- readonly prompt: {
15
- readonly type: "string";
16
- readonly description: "The prompt that will be used to generate the image. This prompt must be detailed, it will be used by image generation model.";
17
- };
18
- readonly filePath: {
19
- readonly type: "string";
20
- readonly description: "The file path to save the generated image.";
21
- };
22
- readonly contextImagePath: {
23
- readonly type: "string";
24
- readonly description: "Path to a image file that will be used as a context for image generation. It is useful if there is a need to edit an image with genAI.";
25
- };
26
- readonly width: {
27
- readonly type: "number";
28
- readonly description: "width of the image";
29
- };
30
- readonly height: {
31
- readonly type: "number";
32
- readonly description: "height of the image";
33
- };
34
- readonly cheap: {
35
- readonly type: "boolean";
36
- readonly description: "true value means that the prompt will be executed with cheaper model, which work faster, but provides lower quality results, so please use it only in situation when lower quality results are acceptable for the prompt.";
37
- };
38
- };
39
- readonly required: readonly ["prompt", "filePath", "width", "height"];
40
- };
41
- };
5
+ export declare const generateImage: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"generate-image.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/generate-image.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+DAA+D;aAC7E;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8HAA8H;aACjI;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wIAAwI;aAC3I;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,2NAA2N;aAC9N;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;KACpD;CACO,CAAC"}
1
+ {"version":3,"file":"generate-image.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/generate-image.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+DAA+D;aAC7E;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8HAA8H;aACjI;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wIAAwI;aAC3I;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qBAAqB;aACnC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,2NAA2N;aAC9N;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;KACpD;CACF,CAAC"}
@@ -1,20 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for getImageAssets
3
4
  */
4
- export declare const getImageAssets: {
5
- readonly name: "getImageAssets";
6
- readonly description: "This function returns a map of application image assets. This map contains absolute file path, and basic metadata information. It does not contain contents. Contents must be requested using dedicated tool.";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly filePaths: {
11
- readonly type: "array";
12
- readonly description: "An array of absolute paths of files that should be used to provided context.";
13
- readonly items: {
14
- readonly type: "string";
15
- };
16
- };
17
- };
18
- readonly required: readonly [];
19
- };
20
- };
5
+ export declare const getImageAssets: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"get-image-assets.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/get-image-assets.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,+MAA+M;IACjN,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8EAA8E;gBAC3F,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACO,CAAC"}
1
+ {"version":3,"file":"get-image-assets.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/get-image-assets.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,+MAA+M;IACjN,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8EAA8E;gBAC3F,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
@@ -1,20 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for getSourceCode
3
4
  */
4
- export declare const getSourceCode: {
5
- readonly name: "getSourceCode";
6
- readonly description: string;
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly filePaths: {
11
- readonly type: "array";
12
- readonly description: "An array of absolute paths of files that should be used to provided context.";
13
- readonly items: {
14
- readonly type: "string";
15
- };
16
- };
17
- };
18
- readonly required: readonly [];
19
- };
20
- };
5
+ export declare const getSourceCode: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"get-source-code.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/get-source-code.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,kMAAkM;QAClM,wLAAwL;IAC1L,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8EAA8E;gBAC3F,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACO,CAAC"}
1
+ {"version":3,"file":"get-source-code.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/get-source-code.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,kMAAkM;QAClM,wLAAwL;IAC1L,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8EAA8E;gBAC3F,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
@@ -1,46 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for optimizeContext
3
4
  */
4
- export declare const optimizeContext: {
5
- readonly name: "optimizeContext";
6
- readonly description: "This function narrows the context of code generation to a list of relevant files, including their estimated token counts and relevance scores. It helps prioritize files based on their importance to the user prompt and manages token usage.";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly userPrompt: {
11
- readonly type: "string";
12
- readonly description: "The user's original prompt.";
13
- };
14
- readonly optimizedContext: {
15
- readonly type: "array";
16
- readonly description: "An array of objects representing relevant files, their relevance scores, and token counts.";
17
- readonly items: {
18
- readonly type: "object";
19
- readonly properties: {
20
- readonly filePath: {
21
- readonly type: "string";
22
- readonly description: "The absolute file path of a relevant file.";
23
- };
24
- readonly relevance: {
25
- readonly type: "number";
26
- readonly description: "A score from 0 to 1 indicating the relevance of the file to the user prompt.";
27
- readonly minimum: 0;
28
- readonly maximum: 1;
29
- };
30
- readonly tokenCount: {
31
- readonly type: "integer";
32
- readonly description: "The estimated token count for the file content.";
33
- readonly minimum: 0;
34
- };
35
- };
36
- readonly required: readonly ["filePath", "relevance", "tokenCount"];
37
- };
38
- };
39
- readonly totalTokenCount: {
40
- readonly type: "number";
41
- readonly description: "The estimated token count for the entire context.";
42
- };
43
- };
44
- readonly required: readonly ["userPrompt", "optimizedContext", "totalTokenCount"];
45
- };
46
- };
5
+ export declare const optimizeContext: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"optimize-context.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/optimize-context.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,gPAAgP;IAClP,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,4FAA4F;gBACzG,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,4CAA4C;yBAC1D;wBACD,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,8EAA8E;4BAC3F,OAAO,EAAE,CAAC;4BACV,OAAO,EAAE,CAAC;yBACX;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,SAAS;4BACf,WAAW,EAAE,iDAAiD;4BAC9D,OAAO,EAAE,CAAC;yBACX;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC;iBAClD;aACF;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;KAChE;CACO,CAAC"}
1
+ {"version":3,"file":"optimize-context.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/optimize-context.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,gPAAgP;IAClP,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,4FAA4F;gBACzG,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,4CAA4C;yBAC1D;wBACD,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,8EAA8E;4BAC3F,OAAO,EAAE,CAAC;4BACV,OAAO,EAAE,CAAC;yBACX;wBACD,UAAU,EAAE;4BACV,IAAI,EAAE,SAAS;4BACf,WAAW,EAAE,iDAAiD;4BAC9D,OAAO,EAAE,CAAC;yBACX;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC;iBAClD;aACF;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;KAChE;CACF,CAAC"}
@@ -1,13 +1,2 @@
1
- export declare const readHistory: {
2
- name: string;
3
- description: string;
4
- parameters: {
5
- type: string;
6
- properties: {
7
- dateTime: {
8
- type: string;
9
- };
10
- };
11
- required: never[];
12
- };
13
- };
1
+ import { FunctionDef } from '../../ai-service/common';
2
+ export declare const readHistory: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"read-history.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/read-history.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4EAA4E;IACzF,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
1
+ {"version":3,"file":"read-history.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/read-history.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,4EAA4E;IACzF,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC"}
@@ -1,31 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for setSummaries
3
4
  */
4
- export declare const setSummaries: {
5
- readonly name: "setSummaries";
6
- readonly description: "Use this function to save summaries of files";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly summaries: {
11
- readonly type: "array";
12
- readonly description: "An array of results, each corresponding to an analyzed file, containing the absolute file path, and a brief summary.";
13
- readonly items: {
14
- readonly type: "object";
15
- readonly properties: {
16
- readonly filePath: {
17
- readonly type: "string";
18
- readonly description: "The absolute file path of the analyzed file.";
19
- };
20
- readonly summary: {
21
- readonly type: "string";
22
- readonly description: "A summary of the file's content, highlighting its main purpose, functionality, or details which may be useful for context optimization.";
23
- };
24
- };
25
- readonly required: readonly ["filePath", "summary"];
26
- };
27
- };
28
- };
29
- readonly required: readonly ["summaries"];
30
- };
31
- };
5
+ export declare const setSummaries: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"set-summaries.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/set-summaries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,8CAA8C;IAC3D,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,sHAAsH;gBACxH,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,8CAA8C;yBAC5D;wBACD,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,yIAAyI;yBAC5I;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;iBAClC;aACF;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACO,CAAC"}
1
+ {"version":3,"file":"set-summaries.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/set-summaries.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,8CAA8C;IAC3D,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,sHAAsH;gBACxH,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,8CAA8C;yBAC5D;wBACD,OAAO,EAAE;4BACP,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,yIAAyI;yBAC5I;qBACF;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;iBAClC;aACF;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACF,CAAC"}
@@ -1,21 +1,5 @@
1
+ import { FunctionDef } from '../../ai-service/common';
1
2
  /**
2
3
  * Function definition for updateHistory
3
4
  */
4
- export declare const updateHistory: {
5
- readonly name: "updateHistory";
6
- readonly description: "Update the history.";
7
- readonly parameters: {
8
- readonly type: "object";
9
- readonly properties: {
10
- readonly recentConversationSummary: {
11
- readonly type: "string";
12
- readonly description: "Summary of recent conversation";
13
- };
14
- readonly newHistoryContent: {
15
- readonly type: "string";
16
- readonly description: "The new history content, combination of recent conversation summary, and current history";
17
- };
18
- };
19
- readonly required: readonly ["recentConversationSummary", "newHistoryContent"];
20
- };
21
- };
5
+ export declare const updateHistory: FunctionDef;
@@ -1 +1 @@
1
- {"version":3,"file":"update-history.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/update-history.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,yBAAyB,EAAE;gBACzB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0FAA0F;aACxG;SACF;QACD,QAAQ,EAAE,CAAC,2BAA2B,EAAE,mBAAmB,CAAC;KAC7D;CACO,CAAC"}
1
+ {"version":3,"file":"update-history.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/update-history.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAgB;IACxC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,yBAAyB,EAAE;gBACzB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0FAA0F;aACxG;SACF;QACD,QAAQ,EAAE,CAAC,2BAA2B,EAAE,mBAAmB,CAAC;KAC7D;CACF,CAAC"}
@@ -2,10 +2,10 @@ import assert from 'node:assert';
2
2
  import fs from 'fs';
3
3
  import mime from 'mime-types';
4
4
  import { getSystemPrompt } from './systemprompt.js';
5
- import { functionDefs } from './function-calling.js';
5
+ import { getFunctionDefs } from './function-calling.js';
6
6
  import { getSourceCode, getImageAssets } from '../files/read-files.js';
7
7
  import { importantContext } from '../main/config.js';
8
- import { executeStepAskQuestion } from './steps/step-ask-question.js';
8
+ import { executeStepAskQuestion } from './steps/step-ask-question/step-ask-question.js';
9
9
  import { validateAndRecoverSingleResult } from './steps/step-validate-recover.js';
10
10
  import { executeStepVerifyPatch } from './steps/step-verify-patch.js';
11
11
  import { executeStepGenerateImage } from './steps/step-generate-image.js';
@@ -80,7 +80,7 @@ async function executePromptService(generateContentFn, generateImageFn, codegenP
80
80
  }
81
81
  // Execute the ask question step
82
82
  if (codegenPrompt.options.askQuestion !== false && (codegenPrompt.options.interactive || codegenPrompt.options.ui)) {
83
- const askQuestionResult = await executeStepAskQuestion(generateContentFn, prompt, functionDefs, codegenPrompt.options.temperature ?? 0.7, messages, codegenPrompt.options);
83
+ const askQuestionResult = await executeStepAskQuestion(generateContentFn, prompt, getFunctionDefs(), codegenPrompt.options.temperature ?? 0.7, messages, codegenPrompt.options);
84
84
  // Summary based on the ask-question conversation history (may be different from the initial summary)
85
85
  await executeStepGenerateSummary(generateContentFn, prompt, codegenPrompt.options);
86
86
  if (askQuestionResult === StepResult.BREAK) {
@@ -93,7 +93,7 @@ async function executePromptService(generateContentFn, generateImageFn, codegenP
93
93
  }
94
94
  const baseRequest = [
95
95
  prompt,
96
- functionDefs,
96
+ getFunctionDefs(),
97
97
  'codegenSummary',
98
98
  codegenPrompt.options.temperature ?? 0.7,
99
99
  codegenPrompt.options.cheap ?? false,
@@ -156,7 +156,7 @@ async function executePromptService(generateContentFn, generateImageFn, codegenP
156
156
  }
157
157
  const partialRequest = [
158
158
  prompt,
159
- functionDefs,
159
+ getFunctionDefs(),
160
160
  file.updateToolName,
161
161
  file.temperature ?? codegenPrompt.options.temperature,
162
162
  file.cheap === true,
@@ -174,7 +174,7 @@ async function executePromptService(generateContentFn, generateImageFn, codegenP
174
174
  // Verify if patchFile is one of the functions called, and test if patch is valid and can be applied successfully
175
175
  const patchFileCall = partialResult.find((call) => call.name === 'patchFile');
176
176
  if (patchFileCall) {
177
- partialResult = await executeStepVerifyPatch(patchFileCall.args, generateContentFn, prompt, functionDefs, file.temperature ?? codegenPrompt.options.temperature, file.cheap === true, codegenPrompt.options);
177
+ partialResult = await executeStepVerifyPatch(patchFileCall.args, generateContentFn, prompt, getFunctionDefs(), file.temperature ?? codegenPrompt.options.temperature, file.cheap === true, codegenPrompt.options);
178
178
  }
179
179
  // add the code gen result to the context, as the subsequent code gen may depend on the result
180
180
  prompt.push({ type: 'assistant', functionCalls: partialResult }, {