genaicode 0.2.1 → 0.4.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 (232) hide show
  1. package/README.md +11 -0
  2. package/bin/genaicode-dev.js +2 -1
  3. package/bin/genaicode.cjs +4 -4
  4. package/dist/ai-service/ai-studio.js +65 -10
  5. package/dist/ai-service/ai-studio.js.map +1 -1
  6. package/dist/ai-service/anthropic.js +22 -8
  7. package/dist/ai-service/anthropic.js.map +1 -1
  8. package/dist/ai-service/chat-gpt.js +22 -10
  9. package/dist/ai-service/chat-gpt.js.map +1 -1
  10. package/dist/ai-service/common.d.ts +20 -7
  11. package/dist/ai-service/common.js +9 -6
  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/unescape-function-call.d.ts +7 -0
  16. package/dist/ai-service/unescape-function-call.js +59 -0
  17. package/dist/ai-service/unescape-function-call.js.map +1 -0
  18. package/dist/ai-service/unescape-function-call.test.js +18 -0
  19. package/dist/ai-service/unescape-function-call.test.js.map +1 -0
  20. package/dist/ai-service/vertex-ai-claude.js +11 -4
  21. package/dist/ai-service/vertex-ai-claude.js.map +1 -1
  22. package/dist/ai-service/vertex-ai.d.ts +1 -1
  23. package/dist/ai-service/vertex-ai.js +73 -14
  24. package/dist/ai-service/vertex-ai.js.map +1 -1
  25. package/dist/cli/cli-options.js +8 -0
  26. package/dist/cli/cli-options.js.map +1 -1
  27. package/dist/cli/cli-params.d.ts +6 -0
  28. package/dist/cli/cli-params.js +25 -4
  29. package/dist/cli/cli-params.js.map +1 -1
  30. package/dist/cli/validate-cli-params.js +11 -1
  31. package/dist/cli/validate-cli-params.js.map +1 -1
  32. package/dist/files/cache-file.d.ts +3 -0
  33. package/dist/files/cache-file.js +36 -0
  34. package/dist/files/cache-file.js.map +1 -0
  35. package/dist/files/find-files.d.ts +1 -0
  36. package/dist/files/find-files.js +7 -2
  37. package/dist/files/find-files.js.map +1 -1
  38. package/dist/files/read-files.d.ts +6 -3
  39. package/dist/files/read-files.js +7 -5
  40. package/dist/files/read-files.js.map +1 -1
  41. package/dist/files/read-files.test.js +2 -1
  42. package/dist/files/read-files.test.js.map +1 -1
  43. package/dist/files/update-files.js +1 -4
  44. package/dist/files/update-files.js.map +1 -1
  45. package/dist/main/codegen-types.d.ts +15 -0
  46. package/dist/main/codegen.d.ts +2 -2
  47. package/dist/main/codegen.js +91 -52
  48. package/dist/main/codegen.js.map +1 -1
  49. package/dist/main/codegen.test.d.ts +1 -0
  50. package/dist/main/codegen.test.js +24 -8
  51. package/dist/main/codegen.test.js.map +1 -1
  52. package/dist/main/common/content-bus-types.d.ts +16 -0
  53. package/dist/main/common/content-bus-types.js +7 -0
  54. package/dist/main/common/content-bus-types.js.map +1 -0
  55. package/dist/main/common/content-bus.d.ts +9 -0
  56. package/dist/main/common/content-bus.js +25 -0
  57. package/dist/main/common/content-bus.js.map +1 -0
  58. package/dist/main/common/cost-collector.d.ts +11 -0
  59. package/dist/main/common/cost-collector.js +90 -0
  60. package/dist/main/common/cost-collector.js.map +1 -0
  61. package/dist/main/common/user-actions.d.ts +7 -0
  62. package/dist/main/common/user-actions.js +15 -0
  63. package/dist/main/common/user-actions.js.map +1 -0
  64. package/dist/main/config-lib.d.ts +19 -0
  65. package/dist/main/config-lib.js.map +1 -1
  66. package/dist/main/config.d.ts +2 -1
  67. package/dist/main/config.js +3 -0
  68. package/dist/main/config.js.map +1 -1
  69. package/dist/main/interactive/codegen-interactive.js +8 -2
  70. package/dist/main/interactive/codegen-interactive.js.map +1 -1
  71. package/dist/main/interactive/codegen-interactive.test.d.ts +1 -0
  72. package/dist/main/interactive/codegen-interactive.test.js +2 -0
  73. package/dist/main/interactive/codegen-interactive.test.js.map +1 -1
  74. package/dist/main/interactive/codegen-worker.d.ts +1 -1
  75. package/dist/main/interactive/codegen-worker.js +10 -4
  76. package/dist/main/interactive/codegen-worker.js.map +1 -1
  77. package/dist/main/interactive/task-file.js +9 -2
  78. package/dist/main/interactive/task-file.js.map +1 -1
  79. package/dist/main/interactive/user-action-handlers.d.ts +1 -0
  80. package/dist/main/interactive/user-action-handlers.js +13 -0
  81. package/dist/main/interactive/user-action-handlers.js.map +1 -0
  82. package/dist/main/interactive/user-interrupt.js +1 -1
  83. package/dist/main/interactive/user-interrupt.js.map +1 -1
  84. package/dist/main/ui/backend/api-utils.d.ts +2 -0
  85. package/dist/main/ui/backend/api-utils.js +18 -0
  86. package/dist/main/ui/backend/api-utils.js.map +1 -0
  87. package/dist/main/ui/backend/api.d.ts +2 -0
  88. package/dist/main/ui/backend/api.js +186 -0
  89. package/dist/main/ui/backend/api.js.map +1 -0
  90. package/dist/main/ui/backend/server.d.ts +2 -0
  91. package/dist/main/ui/backend/server.js +85 -0
  92. package/dist/main/ui/backend/server.js.map +1 -0
  93. package/dist/main/ui/backend/service.d.ts +48 -0
  94. package/dist/main/ui/backend/service.js +161 -0
  95. package/dist/main/ui/backend/service.js.map +1 -0
  96. package/dist/main/ui/codegen-ui.d.ts +2 -0
  97. package/dist/main/ui/codegen-ui.js +13 -0
  98. package/dist/main/ui/codegen-ui.js.map +1 -0
  99. package/dist/main/ui/frontend/assets/index-Bj9ZkmiD.js +638 -0
  100. package/dist/main/ui/frontend/assets/index-S_ocA1xG.css +1 -0
  101. package/dist/main/ui/frontend/assets/logo-BGHkG1-J.png +0 -0
  102. package/dist/main/ui/frontend/assets/logo-dark-KAsU1C78.png +0 -0
  103. package/dist/main/ui/frontend/assets/press-start-2p-cyrillic-400-normal-oElOGqNf.woff2 +0 -0
  104. package/dist/main/ui/frontend/assets/press-start-2p-cyrillic-ext-400-normal-COIQET2s.woff2 +0 -0
  105. package/dist/main/ui/frontend/assets/press-start-2p-greek-400-normal-DUIT0YPZ.woff2 +0 -0
  106. package/dist/main/ui/frontend/assets/press-start-2p-latin-400-normal-BKfmdmKK.woff +0 -0
  107. package/dist/main/ui/frontend/assets/press-start-2p-latin-400-normal-xj9lRvVs.woff2 +0 -0
  108. package/dist/main/ui/frontend/assets/press-start-2p-latin-ext-400-normal-B18ub5-k.woff +0 -0
  109. package/dist/main/ui/frontend/assets/press-start-2p-latin-ext-400-normal-DDIa4im3.woff2 +0 -0
  110. package/dist/main/ui/frontend/index.html +16 -0
  111. package/dist/main/ui/user-action-handlers.d.ts +2 -0
  112. package/dist/main/ui/user-action-handlers.js +9 -0
  113. package/dist/main/ui/user-action-handlers.js.map +1 -0
  114. package/dist/prompt/ai-service-fallback.d.ts +3 -0
  115. package/dist/prompt/ai-service-fallback.js +84 -0
  116. package/dist/prompt/ai-service-fallback.js.map +1 -0
  117. package/dist/prompt/function-calling-validate.js +70 -4
  118. package/dist/prompt/function-calling-validate.js.map +1 -1
  119. package/dist/prompt/function-calling.js +11 -1
  120. package/dist/prompt/function-calling.js.map +1 -1
  121. package/dist/prompt/function-defs/ask-question-reflect.d.ts +20 -0
  122. package/dist/prompt/function-defs/ask-question-reflect.js +21 -0
  123. package/dist/prompt/function-defs/ask-question-reflect.js.map +1 -0
  124. package/dist/prompt/function-defs/ask-question.d.ts +31 -20
  125. package/dist/prompt/function-defs/ask-question.js +51 -21
  126. package/dist/prompt/function-defs/ask-question.js.map +1 -1
  127. package/dist/prompt/function-defs/codegen-summary.d.ts +23 -21
  128. package/dist/prompt/function-defs/codegen-summary.js +28 -28
  129. package/dist/prompt/function-defs/codegen-summary.js.map +1 -1
  130. package/dist/prompt/function-defs/create-file.d.ts +4 -4
  131. package/dist/prompt/function-defs/create-file.js +4 -4
  132. package/dist/prompt/function-defs/create-file.js.map +1 -1
  133. package/dist/prompt/function-defs/delete-file.d.ts +4 -4
  134. package/dist/prompt/function-defs/delete-file.js +4 -4
  135. package/dist/prompt/function-defs/delete-file.js.map +1 -1
  136. package/dist/prompt/function-defs/generate-image.d.ts +4 -4
  137. package/dist/prompt/function-defs/generate-image.js +4 -4
  138. package/dist/prompt/function-defs/generate-image.js.map +1 -1
  139. package/dist/prompt/function-defs/get-source-code.d.ts +1 -1
  140. package/dist/prompt/function-defs/get-source-code.js +2 -1
  141. package/dist/prompt/function-defs/get-source-code.js.map +1 -1
  142. package/dist/prompt/function-defs/move-file.d.ts +4 -4
  143. package/dist/prompt/function-defs/move-file.js +4 -4
  144. package/dist/prompt/function-defs/move-file.js.map +1 -1
  145. package/dist/prompt/function-defs/optimize-context.d.ts +46 -0
  146. package/dist/prompt/function-defs/optimize-context.js +47 -0
  147. package/dist/prompt/function-defs/optimize-context.js.map +1 -0
  148. package/dist/prompt/function-defs/patch-file.d.ts +4 -4
  149. package/dist/prompt/function-defs/patch-file.js +4 -4
  150. package/dist/prompt/function-defs/patch-file.js.map +1 -1
  151. package/dist/prompt/function-defs/read-history.d.ts +13 -0
  152. package/dist/prompt/function-defs/read-history.js +14 -0
  153. package/dist/prompt/function-defs/read-history.js.map +1 -0
  154. package/dist/prompt/function-defs/set-summaries.d.ts +31 -0
  155. package/dist/prompt/function-defs/set-summaries.js +32 -0
  156. package/dist/prompt/function-defs/set-summaries.js.map +1 -0
  157. package/dist/prompt/function-defs/update-file.d.ts +4 -4
  158. package/dist/prompt/function-defs/update-file.js +4 -4
  159. package/dist/prompt/function-defs/update-file.js.map +1 -1
  160. package/dist/prompt/function-defs/update-history.d.ts +21 -0
  161. package/dist/prompt/function-defs/update-history.js +22 -0
  162. package/dist/prompt/function-defs/update-history.js.map +1 -0
  163. package/dist/prompt/limits.d.ts +3 -3
  164. package/dist/prompt/limits.js +10 -8
  165. package/dist/prompt/limits.js.map +1 -1
  166. package/dist/prompt/limits.test.js +6 -6
  167. package/dist/prompt/limits.test.js.map +1 -1
  168. package/dist/prompt/prompt-codegen.js +52 -25
  169. package/dist/prompt/prompt-codegen.js.map +1 -1
  170. package/dist/prompt/prompt-codegen.test.js +2 -2
  171. package/dist/prompt/prompt-codegen.test.js.map +1 -1
  172. package/dist/prompt/prompt-service-ask-question.test.d.ts +1 -0
  173. package/dist/prompt/prompt-service-ask-question.test.js +86 -13
  174. package/dist/prompt/prompt-service-ask-question.test.js.map +1 -1
  175. package/dist/prompt/prompt-service.d.ts +3 -10
  176. package/dist/prompt/prompt-service.js +66 -23
  177. package/dist/prompt/prompt-service.js.map +1 -1
  178. package/dist/prompt/prompt-service.test.d.ts +1 -0
  179. package/dist/prompt/prompt-service.test.js +73 -48
  180. package/dist/prompt/prompt-service.test.js.map +1 -1
  181. package/dist/prompt/steps/step-ask-question-handlers.d.ts +10 -0
  182. package/dist/prompt/steps/step-ask-question-handlers.js +265 -0
  183. package/dist/prompt/steps/step-ask-question-handlers.js.map +1 -0
  184. package/dist/prompt/steps/step-ask-question-reflect.d.ts +4 -0
  185. package/dist/prompt/steps/step-ask-question-reflect.js +40 -0
  186. package/dist/prompt/steps/step-ask-question-reflect.js.map +1 -0
  187. package/dist/prompt/steps/step-ask-question-types.d.ts +60 -0
  188. package/dist/prompt/steps/step-ask-question-types.js +2 -0
  189. package/dist/prompt/steps/step-ask-question-types.js.map +1 -0
  190. package/dist/prompt/steps/step-ask-question.d.ts +3 -3
  191. package/dist/prompt/steps/step-ask-question.js +69 -69
  192. package/dist/prompt/steps/step-ask-question.js.map +1 -1
  193. package/dist/prompt/steps/step-context-optimization.d.ts +4 -0
  194. package/dist/prompt/steps/step-context-optimization.js +193 -0
  195. package/dist/prompt/steps/step-context-optimization.js.map +1 -0
  196. package/dist/prompt/steps/step-history-update.d.ts +5 -0
  197. package/dist/prompt/steps/step-history-update.js +54 -0
  198. package/dist/prompt/steps/step-history-update.js.map +1 -0
  199. package/dist/prompt/steps/step-summarization.d.ts +8 -0
  200. package/dist/prompt/steps/step-summarization.js +75 -0
  201. package/dist/prompt/steps/step-summarization.js.map +1 -0
  202. package/dist/prompt/steps/step-validate-recover.d.ts +2 -13
  203. package/dist/prompt/steps/step-validate-recover.js +3 -3
  204. package/dist/prompt/steps/step-validate-recover.js.map +1 -1
  205. package/dist/prompt/steps/step-verify-patch.d.ts +1 -2
  206. package/dist/prompt/steps/step-verify-patch.js +3 -10
  207. package/dist/prompt/steps/step-verify-patch.js.map +1 -1
  208. package/dist/prompt/steps/steps-types.d.ts +16 -0
  209. package/dist/prompt/steps/steps-utils.d.ts +7 -0
  210. package/dist/prompt/steps/steps-utils.js +11 -0
  211. package/dist/prompt/steps/steps-utils.js.map +1 -0
  212. package/dist/prompt/systemprompt.d.ts +1 -1
  213. package/dist/prompt/systemprompt.js +194 -32
  214. package/dist/prompt/systemprompt.js.map +1 -1
  215. package/dist/prompt/systemprompt.test.js +5 -8
  216. package/dist/prompt/systemprompt.test.js.map +1 -1
  217. package/dist/prompt/token-estimator.d.ts +8 -0
  218. package/dist/prompt/token-estimator.js +31 -0
  219. package/dist/prompt/token-estimator.js.map +1 -0
  220. package/package.json +28 -4
  221. package/dist/main/codegen-interactive-utils.d.ts +0 -8
  222. package/dist/main/codegen-interactive-utils.js +0 -148
  223. package/dist/main/codegen-interactive-utils.js.map +0 -1
  224. package/dist/main/codegen-interactive.d.ts +0 -2
  225. package/dist/main/codegen-interactive.js +0 -68
  226. package/dist/main/codegen-interactive.js.map +0 -1
  227. package/dist/main/interactive/worker-script.js +0 -24
  228. package/dist/main/interactive/worker-script.js.map +0 -1
  229. package/dist/main/interactive/worker.d.ts +0 -2
  230. package/dist/main/interactive/worker.js +0 -55
  231. package/dist/main/interactive/worker.js.map +0 -1
  232. /package/dist/{main/interactive/worker-script.d.ts → ai-service/unescape-function-call.test.d.ts} +0 -0
@@ -1,70 +1,100 @@
1
1
  /**
2
2
  * Function definition for askQuestion
3
+ *
4
+ * Use this function to ask questions, seek clarification, request file permissions, or manage the flow of the conversation.
5
+ * Each actionType serves a specific purpose, ensuring clarity and proper task execution.
3
6
  */
4
7
  export const askQuestion = {
5
8
  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.',
9
+ 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.',
7
10
  parameters: {
8
11
  type: 'object',
9
12
  properties: {
10
- content: {
13
+ actionType: {
11
14
  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.',
15
+ enum: [
16
+ 'requestAnswer',
17
+ 'requestPermissions',
18
+ 'requestFilesContent',
19
+ 'removeFilesFromContext',
20
+ 'confirmCodeGeneration',
21
+ 'startCodeGeneration',
22
+ 'cancelCodeGeneration',
23
+ 'contextOptimization',
24
+ ],
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
+ `,
13
37
  },
14
- shouldPrompt: {
15
- type: 'boolean',
16
- description: 'Set to true if the intention is to get response from the user.',
38
+ content: {
39
+ type: 'string',
40
+ 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.',
17
41
  },
18
42
  promptNecessity: {
19
43
  type: 'number',
20
44
  minimum: 0,
21
45
  maximum: 100,
22
- description: 'How strong is the need to prompt the user? Higher value indicates a stronger need.',
23
- },
24
- stopCodegen: {
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.',
46
+ description: 'Indicates how strongly you need a response from the user. A higher value means a stronger need for user input.',
27
47
  },
28
48
  requestFilesContent: {
29
49
  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.',
50
+ 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
51
  items: {
33
52
  type: 'string',
34
53
  },
35
54
  },
55
+ removeFilesFromContext: {
56
+ type: 'array',
57
+ 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.',
58
+ items: {
59
+ type: 'string',
60
+ },
61
+ },
62
+ contextOptimization: {
63
+ type: 'string',
64
+ 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.',
65
+ },
36
66
  requestPermissions: {
37
67
  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.",
68
+ description: 'Use this to request additional permissions needed for code generation if they are not already granted.',
39
69
  properties: {
40
70
  allowDirectoryCreate: {
41
- description: 'Set to `true` to request permission for creating directories.',
71
+ description: 'Set to true to request permission for creating directories.',
42
72
  type: 'boolean',
43
73
  },
44
74
  allowFileCreate: {
45
- description: 'Set to `true` to request permission for creating files.',
75
+ description: 'Set to true to request permission for creating files.',
46
76
  type: 'boolean',
47
77
  },
48
78
  allowFileDelete: {
49
- description: 'Set to `true` to request permission for deleting files.',
79
+ description: 'Set to true to request permission for deleting files.',
50
80
  type: 'boolean',
51
81
  },
52
82
  allowFileMove: {
53
- description: 'Set to `true` to request permission for moving files.',
83
+ description: 'Set to true to request permission for moving files.',
54
84
  type: 'boolean',
55
85
  },
56
86
  enableVision: {
57
- description: 'Set to `true` to request permission for vision capabilities, using images as a context for further code generation operations.',
87
+ description: 'Set to true to request permission for vision capabilities, using images as context for code generation.',
58
88
  type: 'boolean',
59
89
  },
60
90
  enableImagen: {
61
- description: 'Set to `true` to request permission for generation of images.',
91
+ description: 'Set to true to request permission for generating images.',
62
92
  type: 'boolean',
63
93
  },
64
94
  },
65
95
  },
66
96
  },
67
- required: ['content', 'shouldPrompt', 'promptNecessity', 'stopCodegen'],
97
+ required: ['actionType', 'content', 'promptNecessity'],
68
98
  },
69
99
  };
70
100
  //# 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;;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":[],"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"}
@@ -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
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
- readonly path: {
21
+ readonly filePath: {
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 ["filePath", "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.\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
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
- path: {
25
+ filePath: {
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: ['filePath', '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,wGAAwG;QACxG,2EAA2E;QAC3E,kEAAkE;IACpE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,8OAA8O;gBAChP,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,sFAAsF;gBACnG,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,6JAA6J;oBAC/J,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,gGAAgG;yBACnG;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,6DAA6D;yBAC3E;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,mOAAmO;yBACtO;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,SAAS;4BACf,WAAW,EACT,2NAA2N;yBAC9N;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,0NAA0N;yBAC7N;wBACD,kBAAkB,EAAE;4BAClB,IAAI,EAAE,OAAO;4BACb,WAAW,EACT,gGAAgG;gCAChG,qEAAqE;4BACvE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;yBAC1B;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC;iBACrC;aACF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gFAAgF;aAC9F;SACF;QACD,QAAQ,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,+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"}
@@ -11,14 +11,14 @@ export declare const createFile: {
11
11
  readonly type: "string";
12
12
  readonly description: "Path of the file that will be created, it must not be empty.";
13
13
  };
14
- readonly newContent: {
15
- readonly type: "string";
16
- readonly description: "Content of the file that will be created, it must no be empty.";
17
- };
18
14
  readonly explanation: {
19
15
  readonly type: "string";
20
16
  readonly description: "The explanation of the reasoning behind creating this file";
21
17
  };
18
+ readonly newContent: {
19
+ readonly type: "string";
20
+ readonly description: "Content of the file that will be created, it must no be empty.";
21
+ };
22
22
  };
23
23
  readonly required: readonly ["filePath", "newContent"];
24
24
  };
@@ -11,14 +11,14 @@ export const createFile = {
11
11
  type: 'string',
12
12
  description: 'Path of the file that will be created, it must not be empty.',
13
13
  },
14
- newContent: {
15
- type: 'string',
16
- description: 'Content of the file that will be created, it must no be empty.',
17
- },
18
14
  explanation: {
19
15
  type: 'string',
20
16
  description: 'The explanation of the reasoning behind creating this file',
21
17
  },
18
+ newContent: {
19
+ type: 'string',
20
+ description: 'Content of the file that will be created, it must no be empty.',
21
+ },
22
22
  },
23
23
  required: ['filePath', 'newContent'],
24
24
  },
@@ -1 +1 @@
1
- {"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/create-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,iKAAiK;IACnK,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8DAA8D;aAC5E;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gEAAgE;aAC9E;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4DAA4D;aAC1E;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;KACrC;CACO,CAAC"}
1
+ {"version":3,"file":"create-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/create-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,iKAAiK;IACnK,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8DAA8D;aAC5E;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4DAA4D;aAC1E;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gEAAgE;aAC9E;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;KACrC;CACO,CAAC"}
@@ -7,14 +7,14 @@ export declare const deleteFile: {
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
10
- readonly filePath: {
11
- readonly type: "string";
12
- readonly description: "The file path to delete.";
13
- };
14
10
  readonly explanation: {
15
11
  readonly type: "string";
16
12
  readonly description: "The explanation of the reasoning behind deleting this file";
17
13
  };
14
+ readonly filePath: {
15
+ readonly type: "string";
16
+ readonly description: "The file path to delete.";
17
+ };
18
18
  };
19
19
  readonly required: readonly ["filePath"];
20
20
  };
@@ -7,14 +7,14 @@ export const deleteFile = {
7
7
  parameters: {
8
8
  type: 'object',
9
9
  properties: {
10
- filePath: {
11
- type: 'string',
12
- description: 'The file path to delete.',
13
- },
14
10
  explanation: {
15
11
  type: 'string',
16
12
  description: 'The explanation of the reasoning behind deleting this file',
17
13
  },
14
+ filePath: {
15
+ type: 'string',
16
+ description: 'The file path to delete.',
17
+ },
18
18
  },
19
19
  required: ['filePath'],
20
20
  },
@@ -1 +1 @@
1
- {"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/delete-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4DAA4D;aAC1E;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;CACO,CAAC"}
1
+ {"version":3,"file":"delete-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/delete-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4DAA4D;aAC1E;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0BAA0B;aACxC;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;CACO,CAAC"}
@@ -7,6 +7,10 @@ export declare const generateImage: {
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
10
+ readonly explanation: {
11
+ readonly type: "string";
12
+ readonly description: "The explanation of the reasoning behind generating this image";
13
+ };
10
14
  readonly prompt: {
11
15
  readonly type: "string";
12
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.";
@@ -31,10 +35,6 @@ export declare const generateImage: {
31
35
  readonly type: "boolean";
32
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.";
33
37
  };
34
- readonly explanation: {
35
- readonly type: "string";
36
- readonly description: "The explanation of the reasoning behind generating this image";
37
- };
38
38
  };
39
39
  readonly required: readonly ["prompt", "filePath", "width", "height"];
40
40
  };
@@ -7,6 +7,10 @@ export const generateImage = {
7
7
  parameters: {
8
8
  type: 'object',
9
9
  properties: {
10
+ explanation: {
11
+ type: 'string',
12
+ description: 'The explanation of the reasoning behind generating this image',
13
+ },
10
14
  prompt: {
11
15
  type: 'string',
12
16
  description: 'The prompt that will be used to generate the image. This prompt must be detailed, it will be used by image generation model.',
@@ -31,10 +35,6 @@ export const generateImage = {
31
35
  type: 'boolean',
32
36
  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.',
33
37
  },
34
- explanation: {
35
- type: 'string',
36
- description: 'The explanation of the reasoning behind generating this image',
37
- },
38
38
  },
39
39
  required: ['prompt', 'filePath', 'width', 'height'],
40
40
  },
@@ -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,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;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,+DAA+D;aAC7E;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":"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"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export declare const getSourceCode: {
5
5
  readonly name: "getSourceCode";
6
- readonly description: "This function returns source code of the application in Map format, where absolute file path is the key, and the value is an object, where one of the properties may be the content of the file. Some keys may not provide content. This function can be called only once during the conversation, and only if suggested by the user.";
6
+ readonly description: string;
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
@@ -3,7 +3,8 @@
3
3
  */
4
4
  export const getSourceCode = {
5
5
  name: 'getSourceCode',
6
- description: 'This function returns source code of the application in Map format, where absolute file path is the key, and the value is an object, where one of the properties may be the content of the file. Some keys may not provide content. This function can be called only once during the conversation, and only if suggested by the user.',
6
+ description: 'This function returns source code of the application in Map format, where absolute file path is the key, and the value is an object, where one of the properties may be the content of the file.' +
7
+ 'Some keys may not provide content. Some keys may provide a short summary of content. This function can be called only once during the conversation, and only if suggested by the user.',
7
8
  parameters: {
8
9
  type: 'object',
9
10
  properties: {
@@ -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,uUAAuU;IACzU,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":"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"}
@@ -7,6 +7,10 @@ export declare const moveFile: {
7
7
  readonly parameters: {
8
8
  readonly type: "object";
9
9
  readonly properties: {
10
+ readonly explanation: {
11
+ readonly type: "string";
12
+ readonly description: "The explanation of the reasoning behind moving this file";
13
+ };
10
14
  readonly source: {
11
15
  readonly type: "string";
12
16
  readonly description: "The current file path.";
@@ -15,10 +19,6 @@ export declare const moveFile: {
15
19
  readonly type: "string";
16
20
  readonly description: "The new file path.";
17
21
  };
18
- readonly explanation: {
19
- readonly type: "string";
20
- readonly description: "The explanation of the reasoning behind moving this file";
21
- };
22
22
  };
23
23
  readonly required: readonly ["source", "destination"];
24
24
  };
@@ -7,6 +7,10 @@ export const moveFile = {
7
7
  parameters: {
8
8
  type: 'object',
9
9
  properties: {
10
+ explanation: {
11
+ type: 'string',
12
+ description: 'The explanation of the reasoning behind moving this file',
13
+ },
10
14
  source: {
11
15
  type: 'string',
12
16
  description: 'The current file path.',
@@ -15,10 +19,6 @@ export const moveFile = {
15
19
  type: 'string',
16
20
  description: 'The new file path.',
17
21
  },
18
- explanation: {
19
- type: 'string',
20
- description: 'The explanation of the reasoning behind moving this file',
21
- },
22
22
  },
23
23
  required: ['source', 'destination'],
24
24
  },
@@ -1 +1 @@
1
- {"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/move-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,0CAA0C;IACvD,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;aACtC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;KACpC;CACO,CAAC"}
1
+ {"version":3,"file":"move-file.js","sourceRoot":"","sources":["../../../src/prompt/function-defs/move-file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,0CAA0C;IACvD,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,wBAAwB;aACtC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oBAAoB;aAClC;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;KACpC;CACO,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Function definition for optimizeContext
3
+ */
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
+ };