genaicode 0.2.1 → 0.3.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 (174) hide show
  1. package/README.md +2 -0
  2. package/bin/genaicode-dev.js +2 -1
  3. package/bin/genaicode.cjs +4 -4
  4. package/dist/ai-service/ai-studio.js +8 -2
  5. package/dist/ai-service/ai-studio.js.map +1 -1
  6. package/dist/ai-service/anthropic.js +21 -8
  7. package/dist/ai-service/anthropic.js.map +1 -1
  8. package/dist/ai-service/chat-gpt.js +21 -10
  9. package/dist/ai-service/chat-gpt.js.map +1 -1
  10. package/dist/ai-service/common.d.ts +9 -5
  11. package/dist/ai-service/common.js +6 -4
  12. package/dist/ai-service/common.js.map +1 -1
  13. package/dist/ai-service/common.test.js +3 -3
  14. package/dist/ai-service/common.test.js.map +1 -1
  15. package/dist/ai-service/vertex-ai-claude.js +5 -4
  16. package/dist/ai-service/vertex-ai-claude.js.map +1 -1
  17. package/dist/ai-service/vertex-ai.js +11 -2
  18. package/dist/ai-service/vertex-ai.js.map +1 -1
  19. package/dist/cli/cli-params.d.ts +2 -0
  20. package/dist/cli/cli-params.js +14 -2
  21. package/dist/cli/cli-params.js.map +1 -1
  22. package/dist/cli/validate-cli-params.js +3 -1
  23. package/dist/cli/validate-cli-params.js.map +1 -1
  24. package/dist/files/find-files.d.ts +1 -0
  25. package/dist/files/find-files.js +7 -2
  26. package/dist/files/find-files.js.map +1 -1
  27. package/dist/files/read-files.d.ts +2 -2
  28. package/dist/files/read-files.js +2 -2
  29. package/dist/files/read-files.js.map +1 -1
  30. package/dist/files/read-files.test.js +1 -1
  31. package/dist/files/read-files.test.js.map +1 -1
  32. package/dist/main/codegen-types.d.ts +13 -0
  33. package/dist/main/codegen.d.ts +2 -2
  34. package/dist/main/codegen.js +86 -52
  35. package/dist/main/codegen.js.map +1 -1
  36. package/dist/main/codegen.test.js +7 -4
  37. package/dist/main/codegen.test.js.map +1 -1
  38. package/dist/main/common/content-bus-types.d.ts +16 -0
  39. package/dist/main/common/content-bus-types.js +7 -0
  40. package/dist/main/common/content-bus-types.js.map +1 -0
  41. package/dist/main/common/content-bus.d.ts +9 -0
  42. package/dist/main/common/content-bus.js +25 -0
  43. package/dist/main/common/content-bus.js.map +1 -0
  44. package/dist/main/common/cost-collector.d.ts +15 -0
  45. package/dist/main/common/cost-collector.js +24 -0
  46. package/dist/main/common/cost-collector.js.map +1 -0
  47. package/dist/main/common/user-actions.d.ts +7 -0
  48. package/dist/main/common/user-actions.js +15 -0
  49. package/dist/main/common/user-actions.js.map +1 -0
  50. package/dist/main/config-lib.d.ts +19 -0
  51. package/dist/main/config-lib.js.map +1 -1
  52. package/dist/main/config.d.ts +2 -1
  53. package/dist/main/config.js +3 -0
  54. package/dist/main/config.js.map +1 -1
  55. package/dist/main/interactive/codegen-interactive.js +8 -2
  56. package/dist/main/interactive/codegen-interactive.js.map +1 -1
  57. package/dist/main/interactive/codegen-worker.d.ts +1 -1
  58. package/dist/main/interactive/codegen-worker.js +5 -2
  59. package/dist/main/interactive/codegen-worker.js.map +1 -1
  60. package/dist/main/interactive/task-file.js +9 -2
  61. package/dist/main/interactive/task-file.js.map +1 -1
  62. package/dist/main/interactive/user-action-handlers.d.ts +1 -0
  63. package/dist/main/interactive/user-action-handlers.js +13 -0
  64. package/dist/main/interactive/user-action-handlers.js.map +1 -0
  65. package/dist/main/interactive/user-interrupt.js +1 -1
  66. package/dist/main/interactive/user-interrupt.js.map +1 -1
  67. package/dist/main/ui/backend/api-utils.d.ts +2 -0
  68. package/dist/main/ui/backend/api-utils.js +18 -0
  69. package/dist/main/ui/backend/api-utils.js.map +1 -0
  70. package/dist/main/ui/backend/api.d.ts +2 -0
  71. package/dist/main/ui/backend/api.js +186 -0
  72. package/dist/main/ui/backend/api.js.map +1 -0
  73. package/dist/main/ui/backend/server.d.ts +2 -0
  74. package/dist/main/ui/backend/server.js +81 -0
  75. package/dist/main/ui/backend/server.js.map +1 -0
  76. package/dist/main/ui/backend/service.d.ts +47 -0
  77. package/dist/main/ui/backend/service.js +161 -0
  78. package/dist/main/ui/backend/service.js.map +1 -0
  79. package/dist/main/ui/codegen-ui.d.ts +2 -0
  80. package/dist/main/ui/codegen-ui.js +13 -0
  81. package/dist/main/ui/codegen-ui.js.map +1 -0
  82. package/dist/main/ui/frontend/assets/index-D9wcaSJU.js +598 -0
  83. package/dist/main/ui/frontend/assets/index-S_ocA1xG.css +1 -0
  84. package/dist/main/ui/frontend/assets/logo-BGHkG1-J.png +0 -0
  85. package/dist/main/ui/frontend/assets/logo-dark-KAsU1C78.png +0 -0
  86. package/dist/main/ui/frontend/assets/press-start-2p-cyrillic-400-normal-oElOGqNf.woff2 +0 -0
  87. package/dist/main/ui/frontend/assets/press-start-2p-cyrillic-ext-400-normal-COIQET2s.woff2 +0 -0
  88. package/dist/main/ui/frontend/assets/press-start-2p-greek-400-normal-DUIT0YPZ.woff2 +0 -0
  89. package/dist/main/ui/frontend/assets/press-start-2p-latin-400-normal-BKfmdmKK.woff +0 -0
  90. package/dist/main/ui/frontend/assets/press-start-2p-latin-400-normal-xj9lRvVs.woff2 +0 -0
  91. package/dist/main/ui/frontend/assets/press-start-2p-latin-ext-400-normal-B18ub5-k.woff +0 -0
  92. package/dist/main/ui/frontend/assets/press-start-2p-latin-ext-400-normal-DDIa4im3.woff2 +0 -0
  93. package/dist/main/ui/frontend/index.html +16 -0
  94. package/dist/main/ui/user-action-handlers.d.ts +2 -0
  95. package/dist/main/ui/user-action-handlers.js +9 -0
  96. package/dist/main/ui/user-action-handlers.js.map +1 -0
  97. package/dist/prompt/ai-service-fallback.d.ts +3 -0
  98. package/dist/prompt/ai-service-fallback.js +79 -0
  99. package/dist/prompt/ai-service-fallback.js.map +1 -0
  100. package/dist/prompt/function-calling.js +3 -1
  101. package/dist/prompt/function-calling.js.map +1 -1
  102. package/dist/prompt/function-defs/ask-question.d.ts +13 -13
  103. package/dist/prompt/function-defs/ask-question.js +13 -14
  104. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  105. package/dist/prompt/function-defs/codegen-summary.d.ts +23 -21
  106. package/dist/prompt/function-defs/codegen-summary.js +28 -28
  107. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  108. package/dist/prompt/function-defs/create-file.d.ts +4 -4
  109. package/dist/prompt/function-defs/create-file.js +4 -4
  110. package/dist/prompt/function-defs/create-file.js.map +1 -1
  111. package/dist/prompt/function-defs/delete-file.d.ts +4 -4
  112. package/dist/prompt/function-defs/delete-file.js +4 -4
  113. package/dist/prompt/function-defs/delete-file.js.map +1 -1
  114. package/dist/prompt/function-defs/generate-image.d.ts +4 -4
  115. package/dist/prompt/function-defs/generate-image.js +4 -4
  116. package/dist/prompt/function-defs/generate-image.js.map +1 -1
  117. package/dist/prompt/function-defs/get-source-code.d.ts +1 -1
  118. package/dist/prompt/function-defs/get-source-code.js +2 -1
  119. package/dist/prompt/function-defs/get-source-code.js.map +1 -1
  120. package/dist/prompt/function-defs/move-file.d.ts +4 -4
  121. package/dist/prompt/function-defs/move-file.js +4 -4
  122. package/dist/prompt/function-defs/move-file.js.map +1 -1
  123. package/dist/prompt/function-defs/optimize-context.d.ts +41 -0
  124. package/dist/prompt/function-defs/optimize-context.js +42 -0
  125. package/dist/prompt/function-defs/optimize-context.js.map +1 -0
  126. package/dist/prompt/function-defs/patch-file.d.ts +4 -4
  127. package/dist/prompt/function-defs/patch-file.js +4 -4
  128. package/dist/prompt/function-defs/patch-file.js.map +1 -1
  129. package/dist/prompt/function-defs/update-file.d.ts +4 -4
  130. package/dist/prompt/function-defs/update-file.js +4 -4
  131. package/dist/prompt/function-defs/update-file.js.map +1 -1
  132. package/dist/prompt/limits.d.ts +3 -3
  133. package/dist/prompt/limits.js +10 -8
  134. package/dist/prompt/limits.js.map +1 -1
  135. package/dist/prompt/limits.test.js +6 -6
  136. package/dist/prompt/limits.test.js.map +1 -1
  137. package/dist/prompt/prompt-codegen.js +38 -23
  138. package/dist/prompt/prompt-codegen.js.map +1 -1
  139. package/dist/prompt/prompt-codegen.test.js +2 -2
  140. package/dist/prompt/prompt-codegen.test.js.map +1 -1
  141. package/dist/prompt/prompt-service-ask-question.test.js +12 -5
  142. package/dist/prompt/prompt-service-ask-question.test.js.map +1 -1
  143. package/dist/prompt/prompt-service.d.ts +3 -9
  144. package/dist/prompt/prompt-service.js +30 -7
  145. package/dist/prompt/prompt-service.js.map +1 -1
  146. package/dist/prompt/prompt-service.test.js +40 -25
  147. package/dist/prompt/prompt-service.test.js.map +1 -1
  148. package/dist/prompt/steps/step-ask-question.d.ts +1 -1
  149. package/dist/prompt/steps/step-ask-question.js +34 -17
  150. package/dist/prompt/steps/step-ask-question.js.map +1 -1
  151. package/dist/prompt/steps/step-context-optimization.d.ts +6 -0
  152. package/dist/prompt/steps/step-context-optimization.js +146 -0
  153. package/dist/prompt/steps/step-context-optimization.js.map +1 -0
  154. package/dist/prompt/systemprompt.d.ts +1 -1
  155. package/dist/prompt/systemprompt.js +82 -32
  156. package/dist/prompt/systemprompt.js.map +1 -1
  157. package/dist/prompt/systemprompt.test.js +5 -8
  158. package/dist/prompt/systemprompt.test.js.map +1 -1
  159. package/dist/prompt/token-estimator.d.ts +8 -0
  160. package/dist/prompt/token-estimator.js +31 -0
  161. package/dist/prompt/token-estimator.js.map +1 -0
  162. package/package.json +24 -4
  163. package/dist/main/codegen-interactive-utils.d.ts +0 -8
  164. package/dist/main/codegen-interactive-utils.js +0 -148
  165. package/dist/main/codegen-interactive-utils.js.map +0 -1
  166. package/dist/main/codegen-interactive.d.ts +0 -2
  167. package/dist/main/codegen-interactive.js +0 -68
  168. package/dist/main/codegen-interactive.js.map +0 -1
  169. package/dist/main/interactive/worker-script.d.ts +0 -1
  170. package/dist/main/interactive/worker-script.js +0 -24
  171. package/dist/main/interactive/worker-script.js.map +0 -1
  172. package/dist/main/interactive/worker.d.ts +0 -2
  173. package/dist/main/interactive/worker.js +0 -55
  174. package/dist/main/interactive/worker.js.map +0 -1
@@ -0,0 +1 @@
1
+ @font-face{font-family:"Press Start 2P";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/press-start-2p-cyrillic-ext-400-normal-COIQET2s.woff2) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAy4AAwAAAAAIggAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABHAAAACcAAAAouPy46k9TLzIAAAFEAAAASQAAAGBn+pnZY21hcAAAAZAAAAEDAAABbE73dwFnYXNwAAAClAAAAAgAAAAIAAAAEGdseWYAAAKcAAAGpgAAF4j6A0EraGVhZAAACUQAAAA1AAAANgh1R95oaGVhAAAJfAAAABoAAAAkBKcD7GhtdHgAAAmYAAAAJAAAALgLOwLubG9jYQAACbwAAAC0AAAAtP8pBR5tYXhwAAAKcAAAABwAAAAgAG4AXm5hbWUAAAqMAAABBQAAAkovcUtlcG9zdAAAC5QAAAEjAAADgWtC4K942mNgZGBg4GJQA0ImFzefEAahnMSSPAY+BhBgARH//4NIAFpJBVUAeNpjYGF+wTiBgZWBgamLKYKBgcEbQjPGMRgxHgLygVIwwMTIgAScI4NcGQ4wMChsYX4B4gPNKVNgYJgPVvkOLKbAwAwAPREMygAAAHjafIqBBkJBAMB2tSMICEQcij4pAAUUEP1IAEQQBEGCIAEUAYh4FAgCQuDKE4A3bDCgBtSB1s+hrGEA9ElIA2iSHDlx5sKVG/cePXu18OkndmIvbXOG/zl07NS5S9fuPHjy4s27r9iO3fIM+Z0fVFJ8C4IHJAUAAACAezNn27ZtX+fsxrlHNOoFvaJRr2y3pQuwaduuYwFhWQUVNXUNTS1t0O1YjxO9TvU50+/cgAuDLg25MuzaiBujbo25k5Yx4cGkR1OeTHs248WsV3PmvVvw4c2igCWfsnKWfVnxbdWPNb/W/dnwb1PQlpBtYTsidkXtidkXdyDhUNKRlHH3HfJ5M48AAAEAAf//AA942t2YzWrcWBCFr9zjMSEORmmECUMIQph5ACHyUF5l5dV9gKy8yjt65ZVXlzjM+TiqnkJRvAiezbTQn9N17qlTP7fS5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npPutMyV9gzazgyKzsHF084b2b/q+bFwy9cnYO6/TFxh+dmZufgof03s7JzUPfdzKzsHP626M4s1J/C/5yuVX5pVsypAA==) format("woff");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:"Press Start 2P";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/press-start-2p-cyrillic-400-normal-oElOGqNf.woff2) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAA3MAA0AAAAAJNwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHREVGAAABMAAAABQAAAAUAA8AbEdTVUIAAAFEAAAAJwAAACi4/LjqT1MvMgAAAWwAAABJAAAAYGf6mjtjbWFwAAABuAAAANAAAAEwa2IDFmdhc3AAAAKIAAAACAAAAAgAAAAQZ2x5ZgAAApAAAAdqAAAYtCQw2fRoZWFkAAAJ/AAAADUAAAA2CHVH3mhoZWEAAAo0AAAAGgAAACQEpwRTaG10eAAAClAAAAAnAAABqJZBBW5sb2NhAAAKeAAAANYAAADWRR8/TW1heHAAAAtQAAAAHAAAACAAfwBebmFtZQAAC2wAAAEFAAACSi9xS2Vwb3N0AAAMdAAAAVYAAAQtpri5sAABAAAADAAAAAAAAAABAGkAAQADeNpjYGRgYOBiUANCJhc3nxAGoZzEkjwGPgYQYAER//+DSABaSQVVAHjaY2BhfsE4gYGVgYGpiymCgYHBG0IzxjEYMR4C8oFSMMDEyIAEnCODXBkOMDAoijG/APGB5pQpMDDMB6t8BxZTYGAGACtJDC0AAAB42j3JMS6DYQAA0PfrBwAQAwIUAAC0gJaZAkABTM7CHcTMiQzOYIFU0sH0hocCxNAgJsobohY0qRFThkrtsSg0ha6QCKmQDU/hraMxl+P/hOYQD8mQDo/hNX9R7jP38XvP9xc/FcB7RgSgDmk8ePYCKlSaUmLIoBGjxvQbMK5BnVbdgkJFipUpV6VajVr12rTr1KFLXK8+PYZNmDRj1px5CxatWLUmZd2WjB3bdu05dORA1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0/UUw/MUwGsVkRPnzmmedS9FuCpVYQ8avUN51/ARIav92HKicEUblNpyIxIopXLlq/biw8qzSVaJEcOj8xIMenoVfSLJCSqdiZZwZhpQi9DKAIY5TvXQShHWKMblfMGypV0Roj0e8WpOlYFWWT5u/WfgAAAB42mJgYgCD/1sZjBiwAQCD8pCgAAAAALCJa9u2bdu2venW/2vOEw8EBHMrJCQsIiomT74ChYoUK1GqTLkKlapUq1GrTr0GjZo0a9GqTbsOnbp069GrT78Bg4YMGzFqzLgJk6ZMmzFrzrwFi5YsW7FqzboNm7Zs27Frz74Dh44cO3HqzLkLl65cu3Hrzr0Hj548e/HqzbsPn758+/HrL3xyfXQUy6T/szTJhwkEMQwF0ZYk23IgO/Zf0nH8WdJjGCtu6JgwS8Nh0guGNEOXXrFhxyHt0JPe9MKNBy8+mQwdE2Zply4Y2LBixyHt0RsnLmkDJwYWmQ5dsWHHJdPFJy3JZTJ/OibMMnB8v2DIMPx+xYYdh4xDT3rTCzcevPhkMXRMmGVcumBgw4odh4xHb5y4ZAycGFhkOXTFhh2XLBefjCSX/03u9TfOxOTSktTk/NwkALFV9RoAAA==) format("woff");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:"Press Start 2P";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/press-start-2p-greek-400-normal-DUIT0YPZ.woff2) format("woff2"),url(data:font/woff;base64,d09GRgABAAAAAAxIAAwAAAAAHHwAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABHAAAACcAAAAouPy46k9TLzIAAAFEAAAASQAAAGBmenzzY21hcAAAAZAAAACPAAAAwBzKHbhnYXNwAAACIAAAAAgAAAAIAAAAEGdseWYAAAIoAAAGMwAAE0zA4Cg3aGVhZAAACFwAAAA1AAAANgh1R95oaGVhAAAIlAAAABoAAAAkBKcD7GhtdHgAAAiwAAAAKQAAAKgNLwRlbG9jYQAACNwAAACkAAAApLZJuyptYXhwAAAJgAAAABwAAAA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YmWcGYaUIvQygCGOU710EoR1ijG5XzBsqVdEaI9HvFqTpWBVlk+bv1n4AAAAeNpiYGIAg/9bGYwYsIFAAIPykOAAEAAAbLJd23Zt28YX+9k254TgYL8ioRy6oS/i0JFjJ06dOXfh0pVrN27duffg0ZNnL169effh05dvP379+RcVE5eQlJKWkZWTV1BUUlYJW1U1dQ1NLW0dXT19A0MjYxNTM3MLSytrG7sqyEK5YRgGw3eGMW/vMabDMTNvh2rrSxRyqPj0M211WL+Fn27Zw/vdHT9O8hDYiaiBX0KawmQ3w43tw53J87zCRGbsR7nouXK/hcpi11KZt5DnMHEHaasD5L5LHrrkCycfU2yXMiNPSF9CyV8xSIG+QXfy3ZaiTyHSU/U+VWjbHB/OmP61zGQ15zoaMaU6GmNaNXR+V9+Kdy945jEVgQvS4R0UpaiwWnRBf5qDgW1p2EDD8o5IapgUDnWkUbWzNqioUWODmhhUO/TJKcm6ZICT0s5Dy1Baz+kWrwx0raC7DjpXwG31KsmlnnMa/4nQG3bZF9bd9RgXu02WtaZ2GdJb0YzpZk0Yb1n4WxZuEjv//vE0ZLIWiUBwJ+fc+OcbbX4BhZvZfQAA) format("woff");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:"Press Start 2P";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/press-start-2p-latin-ext-400-normal-DDIa4im3.woff2) format("woff2"),url(/assets/press-start-2p-latin-ext-400-normal-B18ub5-k.woff) format("woff");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:"Press Start 2P";font-style:normal;font-display:swap;font-weight:400;src:url(/assets/press-start-2p-latin-400-normal-xj9lRvVs.woff2) format("woff2"),url(/assets/press-start-2p-latin-400-normal-BKfmdmKK.woff) format("woff");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@@ -0,0 +1,16 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="description" content="GenAIcode - AI-powered code generation and management tool" />
7
+ <meta name="keywords" content="GenAIcode, AI, code generation, programming" />
8
+ <title>GenAIcode - AI-Powered Code Generation</title>
9
+ <link rel="icon" href="/favicon.ico" type="image/x-icon" />
10
+ <script type="module" crossorigin src="/assets/index-D9wcaSJU.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-S_ocA1xG.css">
12
+ </head>
13
+ <body data-security-token="__SECURITY_TOKEN__">
14
+ <div id="root"></div>
15
+ </body>
16
+ </html>
@@ -0,0 +1,2 @@
1
+ import { Service } from './backend/service.js';
2
+ export declare function registerUserActionHandlers(service: Service): void;
@@ -0,0 +1,9 @@
1
+ import { registerConfirmHandler, registerInputHandler } from '../common/user-actions.js';
2
+ export function registerUserActionHandlers(service) {
3
+ registerInputHandler((_, message) => service.askQuestion(message, false));
4
+ registerConfirmHandler(async (message) => {
5
+ const response = await service.askQuestion(message, true);
6
+ return response.toLowerCase() === 'yes';
7
+ });
8
+ }
9
+ //# sourceMappingURL=user-action-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-action-handlers.js","sourceRoot":"","sources":["../../../src/main/ui/user-action-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGzF,MAAM,UAAU,0BAA0B,CAAC,OAAgB;IACzD,oBAAoB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1E,sBAAsB,CAAC,KAAK,EAAE,OAAe,EAAE,EAAE;QAC/C,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,QAAQ,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { AiServiceType, CodegenOptions } from '../main/codegen-types.js';
2
+ import { GenerateContentFunction } from '../ai-service/common.js';
3
+ export declare function handleAiServiceFallback(generateContentFns: Record<AiServiceType, GenerateContentFunction>, currentService: AiServiceType, options: CodegenOptions, ...args: Parameters<GenerateContentFunction>): Promise<ReturnType<GenerateContentFunction>>;
@@ -0,0 +1,79 @@
1
+ import { putSystemMessage } from '../main/common/content-bus.js';
2
+ import { askUserForConfirmation } from '../main/common/user-actions.js';
3
+ const AI_SERVICES_MAP = [
4
+ [() => process.env.ANTHROPIC_API_KEY, 'anthropic'],
5
+ [() => process.env.GOOGLE_CLOUD_PROJECT && process.env.GOOGLE_CLOUD_REGION, 'vertex-ai-claude'],
6
+ [() => process.env.OPENAI_API_KEY, 'chat-gpt'],
7
+ [() => process.env.GOOGLE_CLOUD_PROJECT, 'vertex-ai'],
8
+ [() => process.env.API_KEY, 'ai-studio'],
9
+ ];
10
+ export async function handleAiServiceFallback(generateContentFns, currentService, options, ...args) {
11
+ let retryCount = 0;
12
+ const maxRetries = AI_SERVICES_MAP.length;
13
+ let permanentService = currentService;
14
+ while (retryCount < maxRetries) {
15
+ try {
16
+ const result = await generateContentFns[permanentService](...args);
17
+ options.aiService = permanentService;
18
+ return result;
19
+ }
20
+ catch (error) {
21
+ if (error instanceof Error) {
22
+ // Check if the error is due to an interruption
23
+ if (error.name === 'AbortError' || error.message.includes('interrupted')) {
24
+ putSystemMessage(`Operation interrupted for ${permanentService}`);
25
+ throw error; // Re-throw the interruption error
26
+ }
27
+ if (error.message.includes('Rate limit exceeded')) {
28
+ putSystemMessage(`Rate limit exceeded for ${permanentService}`);
29
+ if (options.disableAiServiceFallback) {
30
+ if (options.interactive || options.ui) {
31
+ const nextService = getNextAiService(permanentService);
32
+ if (nextService) {
33
+ const shouldSwitch = await askUserForConfirmation(`Rate limit exceeded for ${permanentService}. Would you like to switch to ${nextService}?`, true);
34
+ if (shouldSwitch) {
35
+ putSystemMessage(`Switching to ${nextService} due to rate limiting.`);
36
+ permanentService = nextService;
37
+ retryCount++;
38
+ continue;
39
+ }
40
+ }
41
+ }
42
+ else {
43
+ throw new Error(`Rate limit exceeded for ${permanentService}. AI service fallback is disabled.`);
44
+ }
45
+ }
46
+ else {
47
+ const nextService = getNextAiService(permanentService);
48
+ if (nextService) {
49
+ putSystemMessage(`Rate limit exceeded for ${permanentService}. Automatically switching to ${nextService}.`);
50
+ permanentService = nextService;
51
+ retryCount++;
52
+ }
53
+ else {
54
+ throw new Error(`Rate limit exceeded for ${permanentService}. AI service fallback was not possible.`);
55
+ }
56
+ }
57
+ }
58
+ else {
59
+ // For other types of errors, re-throw
60
+ throw error;
61
+ }
62
+ }
63
+ else {
64
+ // If it's not an Error instance, re-throw
65
+ throw error;
66
+ }
67
+ }
68
+ }
69
+ throw new Error('All AI services have been exhausted due to rate limiting.');
70
+ }
71
+ function getNextAiService(currentService) {
72
+ const options = AI_SERVICES_MAP.filter(([check]) => check()).map(([, service]) => service);
73
+ const currentIndex = options.indexOf(currentService);
74
+ if (currentIndex === -1 || currentIndex === options.length - 1) {
75
+ return undefined;
76
+ }
77
+ return options[currentIndex + 1];
78
+ }
79
+ //# sourceMappingURL=ai-service-fallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-service-fallback.js","sourceRoot":"","sources":["../../src/prompt/ai-service-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAGxE,MAAM,eAAe,GA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YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;AAC/E,CAAC;AAED,SAAS,gBAAgB,CAAC,cAA6B;IACrD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IAC3F,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACrD,IAAI,YAAY,KAAK,CAAC,CAAC,IAAI,YAAY,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;AACnC,CAAC"}
@@ -15,6 +15,7 @@ import { imglyRemoveBackground } from './function-defs/imgly-remove-background.j
15
15
  import { resizeImage } from './function-defs/resize-image.js';
16
16
  import { splitImage } from './function-defs/split-image.js';
17
17
  import { askQuestion } from './function-defs/ask-question.js';
18
+ import { optimizeContext } from './function-defs/optimize-context.js';
18
19
  /**
19
20
  * Function definitions for function calling feature
20
21
  */
@@ -35,10 +36,11 @@ export const functionDefs = [
35
36
  resizeImage,
36
37
  splitImage,
37
38
  askQuestion,
39
+ optimizeContext,
38
40
  // @ts-expect-error (fix this once fun defs are converted to ts)
39
41
  ].map((fd) => {
40
42
  if (requireExplanations && fd.parameters.properties.explanation && !fd.parameters.required.includes('explanation')) {
41
- fd.parameters.required.push('explanation');
43
+ fd.parameters.required.unshift('explanation');
42
44
  }
43
45
  else if (!requireExplanations) {
44
46
  delete fd.parameters.properties.explanation;
@@ -1 +1 @@
1
- {"version":3,"file":"function-calling.js","sourceRoot":"","sources":["../../src/prompt/function-calling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,m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AE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,aAAa;IACb,cAAc;IACd,cAAc;IACd,UAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;IACV,WAAW;IACX,eAAe;IACf,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,qBAAqB;IACrB,WAAW;IACX,UAAU;IACV,WAAW;IACX,eAAe;IACf,gEAAgE;CACjE,CAAC,GAAG,CAAC,CAAC,EAAe,EAAE,EAAE;IACxB,IAAI,mBAAmB,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACnH,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;SAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;IAC9C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC,CAAC"}
@@ -3,61 +3,61 @@
3
3
  */
4
4
  export declare const askQuestion: {
5
5
  readonly name: "askQuestion";
6
- readonly description: "If there is a need ask a question to the user to gather more information or clarification. Alternatively this function can be called also if there is no need to prompt the user with any question.";
6
+ readonly description: "Use this function to ask a question or seek clarification from the user if needed. If you have all the necessary information and are ready to proceed, do not call this function.";
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
10
10
  readonly content: {
11
11
  readonly type: "string";
12
- readonly description: "The message you want to display to the user, it can be either a question or a confirmation/ackoweledgment in case there is no intention to prompt the user.";
12
+ readonly description: "The message you want to display to the user. It can be a question if you need more information, or a confirmation/acknowledgment if you are proceeding without needing a response.";
13
13
  };
14
14
  readonly shouldPrompt: {
15
15
  readonly type: "boolean";
16
- readonly description: "Set to true if the intention is to get response from the user.";
16
+ readonly description: "Set to true **only if** you require a response from the user before proceeding. Set to false if you do not require a response and are ready to proceed with the task.";
17
17
  };
18
18
  readonly promptNecessity: {
19
19
  readonly type: "number";
20
20
  readonly minimum: 0;
21
21
  readonly maximum: 100;
22
- readonly description: "How strong is the need to prompt the user? Higher value indicates a stronger need.";
22
+ readonly description: "Indicates how strongly you need a response from the user. A higher value means a stronger need for user input.";
23
23
  };
24
24
  readonly stopCodegen: {
25
25
  readonly type: "boolean";
26
- readonly description: "If set to true, it will break the code generation process without error, so you should use this parameter if you want to stop the code generation process.";
26
+ readonly description: "Set to true if you want to stop the code generation process without error. Use this when you cannot proceed due to insufficient information or other issues.";
27
27
  };
28
28
  readonly requestFilesContent: {
29
29
  readonly type: "array";
30
- readonly description: string;
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
31
  readonly items: {
32
32
  readonly type: "string";
33
33
  };
34
34
  };
35
35
  readonly requestPermissions: {
36
36
  readonly type: "object";
37
- readonly description: "Use this property to request enablement of permissions for code generation process if you detect that you don't have this permission listed in the requirements.";
37
+ readonly description: "Use this to request additional permissions needed for code generation if they are not already granted.";
38
38
  readonly properties: {
39
39
  readonly allowDirectoryCreate: {
40
- readonly description: "Set to `true` to request permission for creating directories.";
40
+ readonly description: "Set to true to request permission for creating directories.";
41
41
  readonly type: "boolean";
42
42
  };
43
43
  readonly allowFileCreate: {
44
- readonly description: "Set to `true` to request permission for creating files.";
44
+ readonly description: "Set to true to request permission for creating files.";
45
45
  readonly type: "boolean";
46
46
  };
47
47
  readonly allowFileDelete: {
48
- readonly description: "Set to `true` to request permission for deleting files.";
48
+ readonly description: "Set to true to request permission for deleting files.";
49
49
  readonly type: "boolean";
50
50
  };
51
51
  readonly allowFileMove: {
52
- readonly description: "Set to `true` to request permission for moving files.";
52
+ readonly description: "Set to true to request permission for moving files.";
53
53
  readonly type: "boolean";
54
54
  };
55
55
  readonly enableVision: {
56
- readonly description: "Set to `true` to request permission for vision capabilities, using images as a context for further code generation operations.";
56
+ readonly description: "Set to true to request permission for vision capabilities, using images as context for code generation.";
57
57
  readonly type: "boolean";
58
58
  };
59
59
  readonly enableImagen: {
60
- readonly description: "Set to `true` to request permission for generation of images.";
60
+ readonly description: "Set to true to request permission for generating images.";
61
61
  readonly type: "boolean";
62
62
  };
63
63
  };
@@ -3,62 +3,61 @@
3
3
  */
4
4
  export const askQuestion = {
5
5
  name: 'askQuestion',
6
- description: 'If there is a need ask a question to the user to gather more information or clarification. Alternatively this function can be called also if there is no need to prompt the user with any question.',
6
+ description: 'Use this function to ask a question or seek clarification from the user if needed. If you have all the necessary information and are ready to proceed, do not call this function.',
7
7
  parameters: {
8
8
  type: 'object',
9
9
  properties: {
10
10
  content: {
11
11
  type: 'string',
12
- description: 'The message you want to display to the user, it can be either a question or a confirmation/ackoweledgment in case there is no intention to prompt the user.',
12
+ description: 'The message you want to display to the user. It can be a question if you need more information, or a confirmation/acknowledgment if you are proceeding without needing a response.',
13
13
  },
14
14
  shouldPrompt: {
15
15
  type: 'boolean',
16
- description: 'Set to true if the intention is to get response from the user.',
16
+ description: 'Set to true **only if** you require a response from the user before proceeding. Set to false if you do not require a response and are ready to proceed with the task.',
17
17
  },
18
18
  promptNecessity: {
19
19
  type: 'number',
20
20
  minimum: 0,
21
21
  maximum: 100,
22
- description: 'How strong is the need to prompt the user? Higher value indicates a stronger need.',
22
+ description: 'Indicates how strongly you need a response from the user. A higher value means a stronger need for user input.',
23
23
  },
24
24
  stopCodegen: {
25
25
  type: 'boolean',
26
- description: 'If set to true, it will break the code generation process without error, so you should use this parameter if you want to stop the code generation process.',
26
+ description: 'Set to true if you want to stop the code generation process without error. Use this when you cannot proceed due to insufficient information or other issues.',
27
27
  },
28
28
  requestFilesContent: {
29
29
  type: 'array',
30
- description: 'This object property is used to request file contents to be provided by the user, use this property when a content of a file is missing(null in getSourceCode response), but we know that it exists.' +
31
- 'An array of absolute paths of files that should be used to provide context for the following updates. Context files could be for example the dependencies, or files that depend on one of the files that we want to update in the next step.',
30
+ 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.',
32
31
  items: {
33
32
  type: 'string',
34
33
  },
35
34
  },
36
35
  requestPermissions: {
37
36
  type: 'object',
38
- description: "Use this property to request enablement of permissions for code generation process if you detect that you don't have this permission listed in the requirements.",
37
+ description: 'Use this to request additional permissions needed for code generation if they are not already granted.',
39
38
  properties: {
40
39
  allowDirectoryCreate: {
41
- description: 'Set to `true` to request permission for creating directories.',
40
+ description: 'Set to true to request permission for creating directories.',
42
41
  type: 'boolean',
43
42
  },
44
43
  allowFileCreate: {
45
- description: 'Set to `true` to request permission for creating files.',
44
+ description: 'Set to true to request permission for creating files.',
46
45
  type: 'boolean',
47
46
  },
48
47
  allowFileDelete: {
49
- description: 'Set to `true` to request permission for deleting files.',
48
+ description: 'Set to true to request permission for deleting files.',
50
49
  type: 'boolean',
51
50
  },
52
51
  allowFileMove: {
53
- description: 'Set to `true` to request permission for moving files.',
52
+ description: 'Set to true to request permission for moving files.',
54
53
  type: 'boolean',
55
54
  },
56
55
  enableVision: {
57
- description: 'Set to `true` to request permission for vision capabilities, using images as a context for further code generation operations.',
56
+ description: 'Set to true to request permission for vision capabilities, using images as context for code generation.',
58
57
  type: 'boolean',
59
58
  },
60
59
  enableImagen: {
61
- description: 'Set to `true` to request permission for generation of images.',
60
+ description: 'Set to true to request permission for generating images.',
62
61
  type: 'boolean',
63
62
  },
64
63
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/ask-question.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,aAAa;IACnB,WAAW,EACT,qMAAqM;IACvM,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6JAA6J;aAChK;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,gEAAgE;aAC9E;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;gBACZ,WAAW,EAAE,oFAAoF;aAClG;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,4JAA4J;aAC/J;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,sMAAsM;oBACtM,8OAA8O;gBAChP,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,kBAAkB,EAAE;gBAClB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kKAAkK;gBACpK,UAAU,EAAE;oBACV,oBAAoB,EAAE;wBACpB,WAAW,EAAE,+DAA+D;wBAC5E,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,yDAAyD;wBACtE,IAAI,EAAE,SAAS;qBAChB;oBACD,eAAe,EAAE;wBACf,WAAW,EAAE,yDAAyD;wBACtE,IAAI,EAAE,SAAS;qBAChB;oBACD,aAAa,EAAE;wBACb,WAAW,EAAE,uDAAuD;wBACpE,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EACT,gIAAgI;wBAClI,IAAI,EAAE,SAAS;qBAChB;oBACD,YAAY,EAAE;wBACZ,WAAW,EAAE,+DAA+D;wBAC5E,IAAI,EAAE,SAAS;qBAChB;iBACF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,CAAC;KACxE;CACO,CAAC"}
1
+ {"version":3,"file":"ask-question.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/ask-question.ts"],"names":[],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C,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,CAAC;KACxE;CACO,CAAC"}
@@ -7,57 +7,59 @@ export declare const codegenSummary: {
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
10
- readonly contextPaths: {
11
- readonly type: "array";
12
- readonly description: "An array of absolute paths of files that should be used to provide context for the following updates. Context files could be for example the dependencies, or files that depend on one of the files that we want to update in the next step.";
13
- readonly items: {
14
- readonly type: "string";
15
- };
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.";
16
13
  };
17
14
  readonly fileUpdates: {
18
15
  readonly type: "array";
19
- readonly description: "An array of proposed file updates, each update is an object with several properties.";
16
+ readonly description: "An array of proposed file updates. Each update is an object with several properties.";
20
17
  readonly items: {
21
18
  readonly type: "object";
22
- readonly description: "Proposed update of a file. The update is an object which contains properties like absolute file path, update tool name, and few other important properties.";
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.";
23
20
  readonly properties: {
24
21
  readonly path: {
25
22
  readonly type: "string";
26
23
  readonly description: "An absolute path of the project file that will be updated. This must be an absolute file path.";
27
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
+ };
28
29
  readonly updateToolName: {
29
30
  readonly type: "string";
30
31
  readonly enum: readonly ["createFile", "updateFile", "patchFile", "deleteFile", "createDirectory", "moveFile", "generateImage", "downloadFile", "splitImage", "resizeImage", "imglyRemoveBackground"];
31
- readonly description: "A name of the tool that will be used to perform the update.";
32
+ readonly description: "The name of the tool that will be used to perform the update.";
32
33
  };
33
34
  readonly temperature: {
34
35
  readonly type: "number";
35
- readonly description: "Temperature parameter that will be used for LLM request. The value is adjusted to the characteristic of the update. If there is a need for a more creative solution, the value should be lower, but stil within [0.0, 2.0] range.";
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;
36
39
  };
37
40
  readonly cheap: {
38
41
  readonly type: "boolean";
39
- 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.";
40
- };
41
- readonly prompt: {
42
- readonly type: "string";
43
- readonly description: "Prompt that will be passed to the model request together with the tool request. It summarizes the planned changes for this particular file, so it should be detailed enough for the model to generate necessary changes.";
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.";
44
43
  };
45
44
  readonly contextImageAssets: {
46
45
  readonly type: "array";
47
- readonly description: string;
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.";
48
47
  readonly items: {
49
48
  readonly type: "string";
50
49
  };
51
50
  };
52
51
  };
53
- readonly required: readonly ["path", "updateToolName"];
52
+ readonly required: readonly ["path", "prompt", "updateToolName"];
54
53
  };
55
54
  };
56
- readonly explanation: {
57
- readonly type: "string";
58
- readonly description: "Explanation of planned changes or explanation of reasoning for no code changes";
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
+ };
59
61
  };
60
62
  };
61
- readonly required: readonly ["fileUpdates", "contextPaths"];
63
+ readonly required: readonly ["explanation", "fileUpdates", "contextPaths"];
62
64
  };
63
65
  };
@@ -3,33 +3,33 @@
3
3
  */
4
4
  export const codegenSummary = {
5
5
  name: 'codegenSummary',
6
- description: 'This function is called with a summary of proposed updates.' +
7
- 'Summary is a data structure(object) which contains:\n' +
8
- '- `fileUpdates`: list of proposed file updates that will be subject to subsequent code generation request\n' +
9
- '- `contextPaths`: list of file paths that make sense to use as a context for code generation requests.' +
10
- '- `explanation`: general explanation of planned code generation updates\n' +
11
- 'It is crticially important to adhere to the schema of parameters',
6
+ description: 'This function is called with a summary of proposed updates. The summary is an object containing:\n' +
7
+ '- `explanation`: A general explanation of the planned code generation updates or reasoning for no code changes.\n' +
8
+ '- `fileUpdates`: A list of proposed file updates that will be subject to subsequent code generation requests.\n' +
9
+ '- `contextPaths`: A list of file paths that make sense to use as context for code generation requests.\n' +
10
+ 'It is critically important to adhere to the schema of parameters.',
12
11
  parameters: {
13
12
  type: 'object',
14
13
  properties: {
15
- contextPaths: {
16
- type: 'array',
17
- description: 'An array of absolute paths of files that should be used to provide context for the following updates. Context files could be for example the dependencies, or files that depend on one of the files that we want to update in the next step.',
18
- items: {
19
- type: 'string',
20
- },
14
+ explanation: {
15
+ type: 'string',
16
+ description: 'A brief description of the planned changes or an explanation if no changes are proposed.',
21
17
  },
22
18
  fileUpdates: {
23
19
  type: 'array',
24
- description: 'An array of proposed file updates, each update is an object with several properties.',
20
+ description: 'An array of proposed file updates. Each update is an object with several properties.',
25
21
  items: {
26
22
  type: 'object',
27
- description: 'Proposed update of a file. The update is an object which contains properties like absolute file path, update tool name, and few other important properties.',
23
+ 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.',
28
24
  properties: {
29
25
  path: {
30
26
  type: 'string',
31
27
  description: 'An absolute path of the project file that will be updated. This must be an absolute file path.',
32
28
  },
29
+ prompt: {
30
+ type: 'string',
31
+ 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.',
32
+ },
33
33
  updateToolName: {
34
34
  type: 'string',
35
35
  enum: [
@@ -45,36 +45,36 @@ export const codegenSummary = {
45
45
  'resizeImage',
46
46
  'imglyRemoveBackground',
47
47
  ],
48
- description: 'A name of the tool that will be used to perform the update.',
48
+ description: 'The name of the tool that will be used to perform the update.',
49
49
  },
50
50
  temperature: {
51
51
  type: 'number',
52
- description: 'Temperature parameter that will be used for LLM request. The value is adjusted to the characteristic of the update. If there is a need for a more creative solution, the value should be lower, but stil within [0.0, 2.0] range.',
52
+ description: 'Temperature parameter for the LLM request. Should be within the range [0.0, 2.0]. Lower values make the output more deterministic.',
53
+ minimum: 0.0,
54
+ maximum: 2.0,
53
55
  },
54
56
  cheap: {
55
57
  type: 'boolean',
56
- 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.',
57
- },
58
- prompt: {
59
- type: 'string',
60
- description: 'Prompt that will be passed to the model request together with the tool request. It summarizes the planned changes for this particular file, so it should be detailed enough for the model to generate necessary changes.',
58
+ 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.',
61
59
  },
62
60
  contextImageAssets: {
63
61
  type: 'array',
64
- description: 'A list of of absolute image asset paths that should be included to the context of LLM request.' +
65
- 'This parameter must be used if there is a need to analyze an image.',
62
+ 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.',
66
63
  items: { type: 'string' },
67
64
  },
68
65
  },
69
- required: ['path', 'updateToolName'],
66
+ required: ['path', 'prompt', 'updateToolName'],
70
67
  },
71
68
  },
72
- explanation: {
73
- type: 'string',
74
- description: 'Explanation of planned changes or explanation of reasoning for no code changes',
69
+ contextPaths: {
70
+ type: 'array',
71
+ 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.',
72
+ items: {
73
+ type: 'string',
74
+ },
75
75
  },
76
76
  },
77
- required: ['fileUpdates', 'contextPaths'],
77
+ required: ['explanation', 'fileUpdates', 'contextPaths'],
78
78
  },
79
79
  };
80
80
  //# 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,6DAA6D;QAC7D,uDAAuD;QACvD,6GAA6G;QAC7G,wG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AQ,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC;KAC1C;CACO,CAAC"}
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,oGAAoG;QACpG,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,IAAI,EAAE;4BACJ,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,IA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