@theia/ai-ide 1.67.0-next.3 → 1.67.0-next.56

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 (306) hide show
  1. package/README.md +1 -0
  2. package/package.json +21 -21
  3. package/src/browser/ai-configuration/agent-configuration-widget.tsx +3 -3
  4. package/src/browser/context-file-validation-service-impl.spec.ts +405 -0
  5. package/src/browser/context-file-validation-service-impl.ts +120 -0
  6. package/src/browser/context-functions.spec.ts +155 -1
  7. package/src/browser/context-functions.ts +40 -6
  8. package/src/browser/file-changeset-functions.spec.ts +13 -13
  9. package/src/browser/file-changeset-functions.ts +9 -9
  10. package/src/browser/frontend-module.ts +12 -4
  11. package/src/browser/ide-chat-welcome-message-provider.tsx +64 -70
  12. package/src/browser/remember-command-contribution.ts +105 -0
  13. package/src/browser/workspace-functions.ts +68 -1
  14. package/src/common/ai-ide-preferences.ts +1 -1
  15. package/src/common/coder-replace-prompt-template.ts +8 -9
  16. package/src/common/command-prompt-template.ts +5 -5
  17. package/src/common/file-changeset-function-ids.ts +15 -1
  18. package/src/common/orchestrator-chat-agent.ts +2 -2
  19. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +0 -41
  20. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +0 -1
  21. package/lib/browser/ai-configuration/agent-configuration-widget.js +0 -333
  22. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +0 -1
  23. package/lib/browser/ai-configuration/ai-configuration-service.d.ts +0 -18
  24. package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +0 -1
  25. package/lib/browser/ai-configuration/ai-configuration-service.js +0 -53
  26. package/lib/browser/ai-configuration/ai-configuration-service.js.map +0 -1
  27. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +0 -14
  28. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +0 -1
  29. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +0 -67
  30. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +0 -1
  31. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +0 -29
  32. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +0 -1
  33. package/lib/browser/ai-configuration/ai-configuration-widget.js +0 -118
  34. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +0 -1
  35. package/lib/browser/ai-configuration/language-model-renderer.d.ts +0 -13
  36. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +0 -1
  37. package/lib/browser/ai-configuration/language-model-renderer.js +0 -104
  38. package/lib/browser/ai-configuration/language-model-renderer.js.map +0 -1
  39. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +0 -43
  40. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +0 -1
  41. package/lib/browser/ai-configuration/mcp-configuration-widget.js +0 -302
  42. package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +0 -1
  43. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +0 -41
  44. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +0 -1
  45. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +0 -226
  46. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +0 -1
  47. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -141
  48. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +0 -1
  49. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -508
  50. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +0 -1
  51. package/lib/browser/ai-configuration/template-settings-renderer.d.ts +0 -10
  52. package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +0 -1
  53. package/lib/browser/ai-configuration/template-settings-renderer.js +0 -48
  54. package/lib/browser/ai-configuration/template-settings-renderer.js.map +0 -1
  55. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +0 -22
  56. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +0 -1
  57. package/lib/browser/ai-configuration/token-usage-configuration-widget.js +0 -156
  58. package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +0 -1
  59. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +0 -30
  60. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +0 -1
  61. package/lib/browser/ai-configuration/tools-configuration-widget.js +0 -150
  62. package/lib/browser/ai-configuration/tools-configuration-widget.js.map +0 -1
  63. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +0 -19
  64. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +0 -1
  65. package/lib/browser/ai-configuration/variable-configuration-widget.js +0 -99
  66. package/lib/browser/ai-configuration/variable-configuration-widget.js.map +0 -1
  67. package/lib/browser/ai-ide-activation-service.d.ts +0 -18
  68. package/lib/browser/ai-ide-activation-service.d.ts.map +0 -1
  69. package/lib/browser/ai-ide-activation-service.js +0 -71
  70. package/lib/browser/ai-ide-activation-service.js.map +0 -1
  71. package/lib/browser/ai-terminal-functions.d.ts +0 -13
  72. package/lib/browser/ai-terminal-functions.d.ts.map +0 -1
  73. package/lib/browser/ai-terminal-functions.js +0 -114
  74. package/lib/browser/ai-terminal-functions.js.map +0 -1
  75. package/lib/browser/app-tester-chat-agent.d.ts +0 -35
  76. package/lib/browser/app-tester-chat-agent.d.ts.map +0 -1
  77. package/lib/browser/app-tester-chat-agent.js +0 -142
  78. package/lib/browser/app-tester-chat-agent.js.map +0 -1
  79. package/lib/browser/app-tester-chat-functions.d.ts +0 -25
  80. package/lib/browser/app-tester-chat-functions.d.ts.map +0 -1
  81. package/lib/browser/app-tester-chat-functions.js +0 -170
  82. package/lib/browser/app-tester-chat-functions.js.map +0 -1
  83. package/lib/browser/app-tester-prompt-template.d.ts +0 -6
  84. package/lib/browser/app-tester-prompt-template.d.ts.map +0 -1
  85. package/lib/browser/app-tester-prompt-template.js +0 -83
  86. package/lib/browser/app-tester-prompt-template.js.map +0 -1
  87. package/lib/browser/architect-agent.d.ts +0 -15
  88. package/lib/browser/architect-agent.d.ts.map +0 -1
  89. package/lib/browser/architect-agent.js +0 -68
  90. package/lib/browser/architect-agent.js.map +0 -1
  91. package/lib/browser/coder-agent.d.ts +0 -15
  92. package/lib/browser/coder-agent.d.ts.map +0 -1
  93. package/lib/browser/coder-agent.js +0 -81
  94. package/lib/browser/coder-agent.js.map +0 -1
  95. package/lib/browser/context-functions.d.ts +0 -14
  96. package/lib/browser/context-functions.d.ts.map +0 -1
  97. package/lib/browser/context-functions.js +0 -130
  98. package/lib/browser/context-functions.js.map +0 -1
  99. package/lib/browser/context-functions.spec.d.ts +0 -2
  100. package/lib/browser/context-functions.spec.d.ts.map +0 -1
  101. package/lib/browser/context-functions.spec.js +0 -93
  102. package/lib/browser/context-functions.spec.js.map +0 -1
  103. package/lib/browser/file-changeset-function.spec.d.ts +0 -2
  104. package/lib/browser/file-changeset-function.spec.d.ts.map +0 -1
  105. package/lib/browser/file-changeset-function.spec.js +0 -45
  106. package/lib/browser/file-changeset-function.spec.js.map +0 -1
  107. package/lib/browser/file-changeset-functions.d.ts +0 -87
  108. package/lib/browser/file-changeset-functions.d.ts.map +0 -1
  109. package/lib/browser/file-changeset-functions.js +0 -645
  110. package/lib/browser/file-changeset-functions.js.map +0 -1
  111. package/lib/browser/file-changeset-functions.spec.d.ts +0 -2
  112. package/lib/browser/file-changeset-functions.spec.d.ts.map +0 -1
  113. package/lib/browser/file-changeset-functions.spec.js +0 -179
  114. package/lib/browser/file-changeset-functions.spec.js.map +0 -1
  115. package/lib/browser/frontend-module.d.ts +0 -5
  116. package/lib/browser/frontend-module.d.ts.map +0 -1
  117. package/lib/browser/frontend-module.js +0 -214
  118. package/lib/browser/frontend-module.js.map +0 -1
  119. package/lib/browser/github-chat-agent.d.ts +0 -48
  120. package/lib/browser/github-chat-agent.d.ts.map +0 -1
  121. package/lib/browser/github-chat-agent.js +0 -222
  122. package/lib/browser/github-chat-agent.js.map +0 -1
  123. package/lib/browser/github-prompt-template.d.ts +0 -6
  124. package/lib/browser/github-prompt-template.d.ts.map +0 -1
  125. package/lib/browser/github-prompt-template.js +0 -53
  126. package/lib/browser/github-prompt-template.js.map +0 -1
  127. package/lib/browser/github-repo-variable-contribution.d.ts +0 -15
  128. package/lib/browser/github-repo-variable-contribution.d.ts.map +0 -1
  129. package/lib/browser/github-repo-variable-contribution.js +0 -82
  130. package/lib/browser/github-repo-variable-contribution.js.map +0 -1
  131. package/lib/browser/ide-chat-welcome-message-provider.d.ts +0 -11
  132. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +0 -1
  133. package/lib/browser/ide-chat-welcome-message-provider.js +0 -142
  134. package/lib/browser/ide-chat-welcome-message-provider.js.map +0 -1
  135. package/lib/browser/project-info-agent.d.ts +0 -13
  136. package/lib/browser/project-info-agent.d.ts.map +0 -1
  137. package/lib/browser/project-info-agent.js +0 -45
  138. package/lib/browser/project-info-agent.js.map +0 -1
  139. package/lib/browser/summarize-session-command-contribution.d.ts +0 -19
  140. package/lib/browser/summarize-session-command-contribution.d.ts.map +0 -1
  141. package/lib/browser/summarize-session-command-contribution.js +0 -118
  142. package/lib/browser/summarize-session-command-contribution.js.map +0 -1
  143. package/lib/browser/task-background-summary-variable.d.ts +0 -9
  144. package/lib/browser/task-background-summary-variable.d.ts.map +0 -1
  145. package/lib/browser/task-background-summary-variable.js +0 -60
  146. package/lib/browser/task-background-summary-variable.js.map +0 -1
  147. package/lib/browser/task-context-agent.d.ts +0 -13
  148. package/lib/browser/task-context-agent.d.ts.map +0 -1
  149. package/lib/browser/task-context-agent.js +0 -45
  150. package/lib/browser/task-context-agent.js.map +0 -1
  151. package/lib/browser/task-context-file-storage-service.d.ts +0 -40
  152. package/lib/browser/task-context-file-storage-service.d.ts.map +0 -1
  153. package/lib/browser/task-context-file-storage-service.js +0 -232
  154. package/lib/browser/task-context-file-storage-service.js.map +0 -1
  155. package/lib/browser/template-preference-contribution.d.ts +0 -17
  156. package/lib/browser/template-preference-contribution.d.ts.map +0 -1
  157. package/lib/browser/template-preference-contribution.js +0 -94
  158. package/lib/browser/template-preference-contribution.js.map +0 -1
  159. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +0 -2
  160. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +0 -1
  161. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +0 -52
  162. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +0 -1
  163. package/lib/browser/workspace-functions.d.ts +0 -75
  164. package/lib/browser/workspace-functions.d.ts.map +0 -1
  165. package/lib/browser/workspace-functions.js +0 -641
  166. package/lib/browser/workspace-functions.js.map +0 -1
  167. package/lib/browser/workspace-functions.spec.d.ts +0 -2
  168. package/lib/browser/workspace-functions.spec.d.ts.map +0 -1
  169. package/lib/browser/workspace-functions.spec.js +0 -161
  170. package/lib/browser/workspace-functions.spec.js.map +0 -1
  171. package/lib/browser/workspace-launch-provider.d.ts +0 -24
  172. package/lib/browser/workspace-launch-provider.d.ts.map +0 -1
  173. package/lib/browser/workspace-launch-provider.js +0 -216
  174. package/lib/browser/workspace-launch-provider.js.map +0 -1
  175. package/lib/browser/workspace-launch-provider.spec.d.ts +0 -2
  176. package/lib/browser/workspace-launch-provider.spec.d.ts.map +0 -1
  177. package/lib/browser/workspace-launch-provider.spec.js +0 -245
  178. package/lib/browser/workspace-launch-provider.spec.js.map +0 -1
  179. package/lib/browser/workspace-search-provider.d.ts +0 -15
  180. package/lib/browser/workspace-search-provider.d.ts.map +0 -1
  181. package/lib/browser/workspace-search-provider.js +0 -204
  182. package/lib/browser/workspace-search-provider.js.map +0 -1
  183. package/lib/browser/workspace-search-provider.spec.d.ts +0 -2
  184. package/lib/browser/workspace-search-provider.spec.d.ts.map +0 -1
  185. package/lib/browser/workspace-search-provider.spec.js +0 -82
  186. package/lib/browser/workspace-search-provider.spec.js.map +0 -1
  187. package/lib/browser/workspace-task-provider.d.ts +0 -15
  188. package/lib/browser/workspace-task-provider.d.ts.map +0 -1
  189. package/lib/browser/workspace-task-provider.js +0 -138
  190. package/lib/browser/workspace-task-provider.js.map +0 -1
  191. package/lib/browser/workspace-task-provider.spec.d.ts +0 -2
  192. package/lib/browser/workspace-task-provider.spec.d.ts.map +0 -1
  193. package/lib/browser/workspace-task-provider.spec.js +0 -109
  194. package/lib/browser/workspace-task-provider.spec.js.map +0 -1
  195. package/lib/common/ai-configuration-preferences.d.ts +0 -8
  196. package/lib/common/ai-configuration-preferences.d.ts.map +0 -1
  197. package/lib/common/ai-configuration-preferences.js +0 -41
  198. package/lib/common/ai-configuration-preferences.js.map +0 -1
  199. package/lib/common/ai-ide-preferences.d.ts +0 -5
  200. package/lib/common/ai-ide-preferences.d.ts.map +0 -1
  201. package/lib/common/ai-ide-preferences.js +0 -53
  202. package/lib/common/ai-ide-preferences.js.map +0 -1
  203. package/lib/common/ai-terminal-functions.d.ts +0 -2
  204. package/lib/common/ai-terminal-functions.d.ts.map +0 -1
  205. package/lib/common/ai-terminal-functions.js +0 -20
  206. package/lib/common/ai-terminal-functions.js.map +0 -1
  207. package/lib/common/app-tester-chat-functions.d.ts +0 -5
  208. package/lib/common/app-tester-chat-functions.d.ts.map +0 -1
  209. package/lib/common/app-tester-chat-functions.js +0 -23
  210. package/lib/common/app-tester-chat-functions.js.map +0 -1
  211. package/lib/common/architect-prompt-template.d.ts +0 -3
  212. package/lib/common/architect-prompt-template.d.ts.map +0 -1
  213. package/lib/common/architect-prompt-template.js +0 -81
  214. package/lib/common/architect-prompt-template.js.map +0 -1
  215. package/lib/common/browser-automation-protocol.d.ts +0 -15
  216. package/lib/common/browser-automation-protocol.d.ts.map +0 -1
  217. package/lib/common/browser-automation-protocol.js +0 -22
  218. package/lib/common/browser-automation-protocol.js.map +0 -1
  219. package/lib/common/coder-replace-prompt-template.d.ts +0 -11
  220. package/lib/common/coder-replace-prompt-template.d.ts.map +0 -1
  221. package/lib/common/coder-replace-prompt-template.js +0 -295
  222. package/lib/common/coder-replace-prompt-template.js.map +0 -1
  223. package/lib/common/command-chat-agents.d.ts +0 -36
  224. package/lib/common/command-chat-agents.d.ts.map +0 -1
  225. package/lib/common/command-chat-agents.js +0 -122
  226. package/lib/common/command-chat-agents.js.map +0 -1
  227. package/lib/common/command-prompt-template.d.ts +0 -3
  228. package/lib/common/command-prompt-template.d.ts.map +0 -1
  229. package/lib/common/command-prompt-template.js +0 -226
  230. package/lib/common/command-prompt-template.js.map +0 -1
  231. package/lib/common/context-files-variable.d.ts +0 -9
  232. package/lib/common/context-files-variable.d.ts.map +0 -1
  233. package/lib/common/context-files-variable.js +0 -52
  234. package/lib/common/context-files-variable.js.map +0 -1
  235. package/lib/common/context-functions.d.ts +0 -4
  236. package/lib/common/context-functions.d.ts.map +0 -1
  237. package/lib/common/context-functions.js +0 -22
  238. package/lib/common/context-functions.js.map +0 -1
  239. package/lib/common/context-variables.d.ts +0 -3
  240. package/lib/common/context-variables.d.ts.map +0 -1
  241. package/lib/common/context-variables.js +0 -21
  242. package/lib/common/context-variables.js.map +0 -1
  243. package/lib/common/file-changeset-function-ids.d.ts +0 -8
  244. package/lib/common/file-changeset-function-ids.d.ts.map +0 -1
  245. package/lib/common/file-changeset-function-ids.js +0 -26
  246. package/lib/common/file-changeset-function-ids.js.map +0 -1
  247. package/lib/common/github-repo-protocol.d.ts +0 -15
  248. package/lib/common/github-repo-protocol.d.ts.map +0 -1
  249. package/lib/common/github-repo-protocol.js +0 -21
  250. package/lib/common/github-repo-protocol.js.map +0 -1
  251. package/lib/common/orchestrator-chat-agent.d.ts +0 -36
  252. package/lib/common/orchestrator-chat-agent.d.ts.map +0 -1
  253. package/lib/common/orchestrator-chat-agent.js +0 -167
  254. package/lib/common/orchestrator-chat-agent.js.map +0 -1
  255. package/lib/common/orchestrator-prompt-template.d.ts +0 -3
  256. package/lib/common/orchestrator-prompt-template.d.ts.map +0 -1
  257. package/lib/common/orchestrator-prompt-template.js +0 -55
  258. package/lib/common/orchestrator-prompt-template.js.map +0 -1
  259. package/lib/common/project-info-prompt-template.d.ts +0 -6
  260. package/lib/common/project-info-prompt-template.d.ts.map +0 -1
  261. package/lib/common/project-info-prompt-template.js +0 -145
  262. package/lib/common/project-info-prompt-template.js.map +0 -1
  263. package/lib/common/summarize-session-commands.d.ts +0 -4
  264. package/lib/common/summarize-session-commands.d.ts.map +0 -1
  265. package/lib/common/summarize-session-commands.js +0 -28
  266. package/lib/common/summarize-session-commands.js.map +0 -1
  267. package/lib/common/task-context-prompt-template.d.ts +0 -8
  268. package/lib/common/task-context-prompt-template.d.ts.map +0 -1
  269. package/lib/common/task-context-prompt-template.js +0 -217
  270. package/lib/common/task-context-prompt-template.js.map +0 -1
  271. package/lib/common/universal-chat-agent.d.ts +0 -17
  272. package/lib/common/universal-chat-agent.d.ts.map +0 -1
  273. package/lib/common/universal-chat-agent.js +0 -47
  274. package/lib/common/universal-chat-agent.js.map +0 -1
  275. package/lib/common/universal-prompt-template.d.ts +0 -4
  276. package/lib/common/universal-prompt-template.d.ts.map +0 -1
  277. package/lib/common/universal-prompt-template.js +0 -32
  278. package/lib/common/universal-prompt-template.js.map +0 -1
  279. package/lib/common/workspace-functions.d.ts +0 -12
  280. package/lib/common/workspace-functions.d.ts.map +0 -1
  281. package/lib/common/workspace-functions.js +0 -30
  282. package/lib/common/workspace-functions.js.map +0 -1
  283. package/lib/common/workspace-preferences.d.ts +0 -10
  284. package/lib/common/workspace-preferences.d.ts.map +0 -1
  285. package/lib/common/workspace-preferences.js +0 -89
  286. package/lib/common/workspace-preferences.js.map +0 -1
  287. package/lib/common/workspace-search-provider-util.d.ts +0 -17
  288. package/lib/common/workspace-search-provider-util.d.ts.map +0 -1
  289. package/lib/common/workspace-search-provider-util.js +0 -51
  290. package/lib/common/workspace-search-provider-util.js.map +0 -1
  291. package/lib/node/app-tester-agent/browser-automation-impl.d.ts +0 -18
  292. package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +0 -1
  293. package/lib/node/app-tester-agent/browser-automation-impl.js +0 -96
  294. package/lib/node/app-tester-agent/browser-automation-impl.js.map +0 -1
  295. package/lib/node/backend-module.d.ts +0 -4
  296. package/lib/node/backend-module.d.ts.map +0 -1
  297. package/lib/node/backend-module.js +0 -45
  298. package/lib/node/backend-module.js.map +0 -1
  299. package/lib/node/github-repo-service-impl.d.ts +0 -7
  300. package/lib/node/github-repo-service-impl.d.ts.map +0 -1
  301. package/lib/node/github-repo-service-impl.js +0 -86
  302. package/lib/node/github-repo-service-impl.js.map +0 -1
  303. package/lib/package.spec.d.ts +0 -1
  304. package/lib/package.spec.d.ts.map +0 -1
  305. package/lib/package.spec.js +0 -26
  306. package/lib/package.spec.js.map +0 -1
@@ -1,11 +0,0 @@
1
- import { BasePromptFragment } from '@theia/ai-core/lib/common';
2
- export declare const CODER_SYSTEM_PROMPT_ID = "coder-system";
3
- export declare const CODER_SIMPLE_EDIT_TEMPLATE_ID = "coder-system-simple-edit";
4
- export declare const CODER_EDIT_TEMPLATE_ID = "coder-system-edit";
5
- export declare const CODER_EDIT_NEXT_TEMPLATE_ID = "coder-system-edit-next";
6
- export declare const CODER_AGENT_MODE_TEMPLATE_ID = "coder-system-agent-mode";
7
- export declare function getCoderAgentModePromptTemplate(): BasePromptFragment;
8
- export declare function getCoderPromptTemplateEdit(): BasePromptFragment;
9
- export declare function getCoderPromptTemplateEditNext(): BasePromptFragment;
10
- export declare function getCoderPromptTemplateSimpleEdit(): BasePromptFragment;
11
- //# sourceMappingURL=coder-replace-prompt-template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coder-replace-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAuB/D,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD,eAAO,MAAM,6BAA6B,6BAA6B,CAAC;AACxE,eAAO,MAAM,sBAAsB,sBAAsB,CAAC;AAC1D,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AACpE,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,wBAAgB,+BAA+B,IAAI,kBAAkB,CAwHpE;AAyED,wBAAgB,0BAA0B,IAAI,kBAAkB,CAK/D;AAED,wBAAgB,8BAA8B,IAAI,kBAAkB,CAMnE;AAED,wBAAgB,gCAAgC,IAAI,kBAAkB,CA8DrE"}
@@ -1,295 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/tslint/config */
3
- // *****************************************************************************
4
- // Copyright (C) 2025 EclipseSource GmbH and others.
5
- //
6
- // This file is licensed under the MIT License.
7
- // See LICENSE-MIT.txt in the project root for license information.
8
- // https://opensource.org/license/mit.
9
- //
10
- // SPDX-License-Identifier: MIT
11
- // *****************************************************************************
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.getCoderPromptTemplateSimpleEdit = exports.getCoderPromptTemplateEditNext = exports.getCoderPromptTemplateEdit = exports.getCoderAgentModePromptTemplate = exports.CODER_AGENT_MODE_TEMPLATE_ID = exports.CODER_EDIT_NEXT_TEMPLATE_ID = exports.CODER_EDIT_TEMPLATE_ID = exports.CODER_SIMPLE_EDIT_TEMPLATE_ID = exports.CODER_SYSTEM_PROMPT_ID = void 0;
14
- const ai_chat_1 = require("@theia/ai-chat");
15
- const workspace_functions_1 = require("./workspace-functions");
16
- const context_variables_1 = require("./context-variables");
17
- const context_functions_1 = require("./context-functions");
18
- const file_changeset_function_ids_1 = require("./file-changeset-function-ids");
19
- exports.CODER_SYSTEM_PROMPT_ID = 'coder-system';
20
- exports.CODER_SIMPLE_EDIT_TEMPLATE_ID = 'coder-system-simple-edit';
21
- exports.CODER_EDIT_TEMPLATE_ID = 'coder-system-edit';
22
- exports.CODER_EDIT_NEXT_TEMPLATE_ID = 'coder-system-edit-next';
23
- exports.CODER_AGENT_MODE_TEMPLATE_ID = 'coder-system-agent-mode';
24
- function getCoderAgentModePromptTemplate() {
25
- return {
26
- id: exports.CODER_AGENT_MODE_TEMPLATE_ID,
27
- template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
28
- Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
29
- https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
30
- You are an **autonomous AI agent** embedded in the Theia IDE to assist developers with tasks like implementing features, fixing bugs, or improving code quality.
31
- You must independently analyze, fix, validate, and finalize all changes — only yield control when all relevant tasks are completed.
32
-
33
- # Agent Behavior
34
-
35
- ## Autonomy and Persistence
36
- You are an agent. **Do not stop until** the entire task is complete:
37
- - All code changes are applied
38
- - The build succeeds
39
- - All lint issues are resolved
40
- - All relevant tests pass
41
- - New tests are written when needed
42
-
43
- You must act **without waiting** for user input unless explicitly required. Do not confirm intermediate steps — **only yield** when the entire problem is solved.
44
-
45
- ## Planning and Reflection
46
- Before each function/tool call:
47
- - Think step-by-step and explain your plan
48
- - State your assumptions
49
- - Justify why you're using a particular tool
50
-
51
- After each tool call:
52
- - Reflect on the result
53
- - Adjust your plan if needed
54
- - Continue to the next logical step
55
-
56
- ## Tool Usage Rules
57
- Never guess or hallucinate file content or structure. Use tools for all workspace interactions:
58
-
59
- ### Workspace Exploration
60
- - ~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}} — list contents of a specific directory
61
- - ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}} — retrieve the content of a file
62
- - ~{${workspace_functions_1.FIND_FILES_BY_PATTERN_FUNCTION_ID}} — find files matching glob patterns (e.g., '**/*.ts' for all TypeScript files)
63
- - ~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}} — locate references or patterns (only search if you are missing information, always prefer examples that are explicitly provided, never \
64
- search for files you already know the path for)
65
- - ~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}} — bookmark important files for context
66
-
67
- ### Code Editing
68
- - Before editing, always retrieve file content
69
- - Use:
70
- - ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} — to immediately apply targeted code changes (no user review)
71
- - ~{${file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID}} — to immediately overwrite a file with new content (no user review)
72
-
73
- - For incremental changes, use multiple ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} calls
74
- - If ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} continuously fails use ~{${file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID}}.
75
-
76
- **IMPORTANT: Do not add comments explaining what you changed or why.**
77
-
78
- ### Validation
79
- - ~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}} — detect syntax, lint, or type errors
80
-
81
- ### Testing & Tasks
82
- - Use ~{${workspace_functions_1.LIST_TASKS_FUNCTION_ID}} to discover available test and lint tasks
83
- - Use ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}} to run linting, building, or test suites
84
-
85
- ### Test Authoring
86
- If no relevant tests exist:
87
- - Create new test files (propose using ~{${file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID}} or ~{${file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID}})
88
- - Use patterns from existing tests
89
- - Ensure new tests validate new behavior or prevent regressions
90
-
91
- # Workflow Steps
92
-
93
- ## 1. Understand the Task
94
- Analyze the user input, retrieve relevant files, and clarify the intent.
95
-
96
- ## 2. Investigate
97
- Use directory listing, file retrieval, and search to gather all needed context.
98
-
99
- ## 3. Plan and Propose Fixes
100
- Develop a step-by-step strategy. Modify relevant files via tool calls.
101
-
102
- ## 4. Run Validation Tools
103
- Run linters and compilers:
104
- - If issues are found, fix them and re-run
105
-
106
- ## 5. Test and Iterate
107
- Run all relevant tests. If failures are found, debug and fix.
108
- - If tests are missing, create them
109
- - Ensure **100% success rate** before proceeding
110
-
111
- ## 6. Final Review
112
- Reflect on whether all objectives are met:
113
- - Code works
114
- - Tests pass
115
- - Code quality meets standards
116
-
117
- Only when **everything is done**, end your turn.
118
-
119
- # Additional Context
120
- The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
121
- Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
122
- {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
123
-
124
- # Previously Changed Files
125
-
126
- {{changeSetSummary}}
127
-
128
- # Project Info
129
-
130
- {{prompt:project-info}}
131
-
132
- {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
133
-
134
- # Final Instruction
135
- You are an autonomous AI agent. Do not stop until:
136
- - All errors are fixed
137
- - Lint and build succeed
138
- - Tests pass
139
- - New tests are created if needed
140
- - No further action is required
141
- `,
142
- ...({ variantOf: exports.CODER_EDIT_TEMPLATE_ID }),
143
- };
144
- }
145
- exports.getCoderAgentModePromptTemplate = getCoderAgentModePromptTemplate;
146
- function getCoderEditPromptTemplate(suggestFileReplacementsId) {
147
- return `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
148
- Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
149
- https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
150
- You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes, \
151
- which will be reviewed and accepted by the user.
152
-
153
- ## Context Retrieval
154
- Use the following functions to interact with the workspace files if you require context:
155
- - **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
156
- - **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
157
- - **~{${workspace_functions_1.FIND_FILES_BY_PATTERN_FUNCTION_ID}}** (find files by glob patterns like '**/*.ts')
158
- - **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
159
-
160
- If you cannot find good search terms, navigate the directory structure.
161
- **Confirm Paths**: Always verify paths by listing directories or files as you navigate. Avoid assumptions based on user input alone.
162
- **Navigate Step-by-Step**: Move into subdirectories only as needed, confirming each directory level.
163
- Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
164
- Only add files that are really relevant to look at later.
165
-
166
- ## Propose Code Changes
167
- To propose code changes or any file changes to the user, never just output them as part of your response, but use the following functions for each file you want to propose \
168
- changes for.
169
- This also applies for newly created files!
170
-
171
- - **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
172
- - **View Pending Changes**: Use ~{${file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
173
- - **Change Content**: Use one of these methods to propose changes:
174
- - ~{${suggestFileReplacementsId}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
175
- - ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
176
- - If ~{${suggestFileReplacementsId}} continuously fails use ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}.
177
- - ~{${file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
178
-
179
- The changes will be presented as an applicable diff to the user in any case. The user can then accept or reject each change individually. Before you run tasks that depend on the \
180
- changes beeing applied, you must wait for the user to review and accept the changes!
181
-
182
- **IMPORTANT: Do not add comments explaining what you changed or why.**
183
-
184
- ## Tasks
185
-
186
- The user might want you to execute some task. You can find tasks using ~{${workspace_functions_1.LIST_TASKS_FUNCTION_ID}} and execute them using ~{${workspace_functions_1.RUN_TASK_FUNCTION_ID}}.
187
- Be aware that tasks operate on the workspace. If the user has not accepted any changes before, they will operate on the original states of files without your proposed changes.
188
- Never execute a task without confirming with the user whether this is wanted!
189
-
190
- ## File Validation
191
-
192
- Use the following function to retrieve a list of problems in a file if the user requests fixes in a given file: **~{${workspace_functions_1.GET_FILE_DIAGNOSTICS_ID}}**
193
- Be aware this function operates on the workspace. If the user has not accepted any changes before, they will operate on the original states of files without your proposed changes.
194
-
195
- ## Additional Context
196
-
197
- The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
198
- Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
199
- {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
200
-
201
- ## Previously Proposed Changes
202
- You have previously proposed changes for the following files. Some suggestions may have been accepted by the user, while others may still be pending.
203
- {{${ai_chat_1.CHANGE_SET_SUMMARY_VARIABLE_ID}}}
204
-
205
- {{prompt:project-info}}
206
-
207
- {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
208
-
209
- ## Final Instruction
210
- - Your task is to propose changes to be reviewed by the user. Always do so using the functions described above.
211
- - Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
212
- - Do not run a build or any error checking before the users asks you to
213
- - Focus on the task that the user described
214
- `;
215
- }
216
- function getCoderPromptTemplateEdit() {
217
- return {
218
- id: exports.CODER_EDIT_TEMPLATE_ID,
219
- template: getCoderEditPromptTemplate(file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID)
220
- };
221
- }
222
- exports.getCoderPromptTemplateEdit = getCoderPromptTemplateEdit;
223
- function getCoderPromptTemplateEditNext() {
224
- return {
225
- id: exports.CODER_EDIT_NEXT_TEMPLATE_ID,
226
- template: getCoderEditPromptTemplate(file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_NEXT_ID),
227
- ...({ variantOf: exports.CODER_EDIT_TEMPLATE_ID })
228
- };
229
- }
230
- exports.getCoderPromptTemplateEditNext = getCoderPromptTemplateEditNext;
231
- function getCoderPromptTemplateSimpleEdit() {
232
- return {
233
- id: exports.CODER_SIMPLE_EDIT_TEMPLATE_ID,
234
- template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
235
- Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
236
- https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
237
- You are an AI assistant integrated into Theia IDE, designed to assist software developers with code tasks. You can interact with the code base and suggest changes \
238
- which will be reviewed and accepted by the user.
239
-
240
- ## Context Retrieval
241
- Use the following functions to interact with the workspace files if you require context:
242
- - **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**
243
- - **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**
244
- - **~{${workspace_functions_1.FIND_FILES_BY_PATTERN_FUNCTION_ID}}** (find files by glob patterns like '**/*.ts')
245
- - **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**
246
-
247
- If you cannot find good search terms, navigate the directory structure.
248
- **Confirm Paths**: Always verify paths by listing directories or files as you navigate. Avoid assumptions based on user input alone.
249
- **Navigate Step-by-Step**: Move into subdirectories only as needed, confirming each directory level.
250
- Remember file locations that are relevant for completing your tasks using **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}**
251
- Only add files that are really relevant to look at later.
252
-
253
- ## Propose Code Changes
254
- To propose code changes or any file changes to the user, never just output them as part of your response, but use the following functions for each file you want to propose \
255
- changes for.
256
- This also applies for newly created files!
257
-
258
- - **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
259
- - **View Pending Changes**: Use ~{${file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
260
- - **Change Content**: Use one of these methods to propose changes:
261
- - ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
262
- - ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
263
- - If ~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}} continuously fails use ~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}.
264
- - ~{${file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
265
-
266
- The changes will be presented as an applicable diff to the user in any case. The user can then accept or reject each change individually. Before you run tasks that depend on the \
267
- changes beeing applied, you must wait for the user to review and accept the changes!
268
-
269
- **IMPORTANT: Do not add comments explaining what you changed or why.**
270
-
271
- ## Additional Context
272
-
273
- The following files have been provided for additional context. Some of them may also be referred to by the user (e.g. "this file" or "the attachment"). \
274
- Always look at the relevant files to understand your task using the function ~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}
275
- {{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
276
-
277
- ## Previously Proposed Changes
278
- You have previously proposed changes for the following files. Some suggestions may have been accepted by the user, while others may still be pending.
279
- {{${ai_chat_1.CHANGE_SET_SUMMARY_VARIABLE_ID}}}
280
-
281
- {{prompt:project-info}}
282
-
283
- {{${context_variables_1.TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
284
-
285
- ## Final Instruction
286
- - Your task is to propose changes to be reviewed by the user. Always do so using the functions described above.
287
- - Tasks such as building or liniting run on the workspace state, the user has to accept the changes beforehand
288
- - Do not run a build or any error checking before the users asks you to
289
- - Focus on the task that the user described
290
- `,
291
- ...({ variantOf: exports.CODER_EDIT_TEMPLATE_ID }),
292
- };
293
- }
294
- exports.getCoderPromptTemplateSimpleEdit = getCoderPromptTemplateSimpleEdit;
295
- //# sourceMappingURL=coder-replace-prompt-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coder-replace-prompt-template.js","sourceRoot":"","sources":["../../src/common/coder-replace-prompt-template.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;AAC/B,gFAAgF;;;AAGhF,4CAAgE;AAChE,+DAQ+B;AAC/B,2DAAkG;AAClG,2DAAuE;AACvE,+EAQuC;AAE1B,QAAA,sBAAsB,GAAG,cAAc,CAAC;AAExC,QAAA,6BAA6B,GAAG,0BAA0B,CAAC;AAC3D,QAAA,sBAAsB,GA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AED,SAAgB,8BAA8B;IAC1C,OAAO;QACH,EAAE,EAAE,mCAA2B;QAC/B,QAAQ,EAAE,0BAA0B,CAAC,+DAAiC,CAAC;QACvE,GAAG,CAAC,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC;KAC7C,CAAC;AACN,CAAC;AAND,wEAMC;AAED,SAAgB,gCAAgC;IAC5C,OAAO;QACH,EAAE,EAAE,qCAA6B;QACjC,QAAQ,EAAE;;;;;;;;QAQV,yDAAmC;QACnC,8CAAwB;QACxB,uDAAiC;QACjC,qDAA+B;;;;;gFAKyC,oDAAgC;;;;;;;;;oCAS5E,qDAAuB;;QAEnD,0DAA4B;QAC5B,qDAAuB;WACpB,0DAA4B,8BAA8B,qDAAuB;QACpF,mDAAqB;;;;;;;;;;iFAUoD,8CAAwB;IACrG,6CAAyB;;;;IAIzB,wCAA8B;;;;IAI9B,oDAAgC;;;;;;;CAOnC;QACO,GAAG,CAAC,EAAE,SAAS,EAAE,8BAAsB,EAAE,CAAC;KAC7C,CAAC;AACN,CAAC;AA9DD,4EA8DC"}
@@ -1,36 +0,0 @@
1
- import { AbstractTextToModelParsingChatAgent, SystemMessageDescription } from '@theia/ai-chat/lib/common/chat-agents';
2
- import { AIVariableContext, LanguageModelRequirement } from '@theia/ai-core';
3
- import { MutableChatRequestModel, ChatResponseContent } from '@theia/ai-chat/lib/common/chat-model';
4
- import { CommandRegistry, MessageService } from '@theia/core';
5
- interface ParsedCommand {
6
- type: 'theia-command' | 'custom-handler' | 'no-command';
7
- commandId: string;
8
- arguments?: string[];
9
- message?: string;
10
- }
11
- export declare class CommandChatAgent extends AbstractTextToModelParsingChatAgent<ParsedCommand> {
12
- protected commandRegistry: CommandRegistry;
13
- protected messageService: MessageService;
14
- id: string;
15
- name: string;
16
- languageModelRequirements: LanguageModelRequirement[];
17
- protected defaultLanguageModelPurpose: string;
18
- description: string;
19
- prompts: import("@theia/ai-core").PromptVariantSet[];
20
- agentSpecificVariables: {
21
- name: string;
22
- description: string;
23
- usedInPrompt: boolean;
24
- }[];
25
- protected getSystemMessageDescription(context: AIVariableContext): Promise<SystemMessageDescription | undefined>;
26
- /**
27
- * @param text the text received from the language model
28
- * @returns the parsed command if the text contained a valid command.
29
- * If there was no json in the text, return a no-command response.
30
- */
31
- protected parseTextResponse(text: string): Promise<ParsedCommand>;
32
- protected createResponseContent(parsedCommand: ParsedCommand, request: MutableChatRequestModel): ChatResponseContent;
33
- protected commandCallback(...commandArgs: unknown[]): Promise<void>;
34
- }
35
- export {};
36
- //# sourceMappingURL=command-chat-agents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-chat-agents.d.ts","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mCAAmC,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EAKtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,eAAe,EACf,cAAc,EAGjB,MAAM,aAAa,CAAC;AAIrB,UAAU,aAAa;IACnB,IAAI,EAAE,eAAe,GAAG,gBAAgB,GAAG,YAAY,CAAA;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBACa,gBAAiB,SAAQ,mCAAmC,CAAC,aAAa,CAAC;IAEpF,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAEzC,EAAE,EAAE,MAAM,CAAa;IACvB,IAAI,SAAa;IACjB,yBAAyB,EAAE,wBAAwB,EAAE,CAGlD;IACH,SAAS,CAAC,2BAA2B,EAAE,MAAM,CAAa;IAEjD,WAAW,SAE8E;IACzF,OAAO,8CAAqB;IAC5B,sBAAsB;;;;QAI5B;cAEsB,2BAA2B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAc/H;;;;OAIG;cACa,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAUvE,SAAS,CAAC,qBAAqB,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,uBAAuB,GAAG,mBAAmB;cAsCpG,eAAe,CAAC,GAAG,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAK5E"}
@@ -1,122 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.CommandChatAgent = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const chat_agents_1 = require("@theia/ai-chat/lib/common/chat-agents");
22
- const chat_model_1 = require("@theia/ai-chat/lib/common/chat-model");
23
- const core_1 = require("@theia/core");
24
- const command_prompt_template_1 = require("./command-prompt-template");
25
- let CommandChatAgent = class CommandChatAgent extends chat_agents_1.AbstractTextToModelParsingChatAgent {
26
- constructor() {
27
- super(...arguments);
28
- this.id = 'Command';
29
- this.name = 'Command';
30
- this.languageModelRequirements = [{
31
- purpose: 'command',
32
- identifier: 'default/universal',
33
- }];
34
- this.defaultLanguageModelPurpose = 'command';
35
- this.description = core_1.nls.localize('theia/ai/ide/commandAgent/description', 'This agent is aware of all commands that the user can execute within the Theia IDE, the tool that the user is currently working with. ' +
36
- 'Based on the user request, it can find the right command and then let the user execute it.');
37
- this.prompts = [command_prompt_template_1.commandTemplate];
38
- this.agentSpecificVariables = [{
39
- name: 'command-ids',
40
- description: core_1.nls.localize('theia/ai/ide/commandAgent/vars/commandIds/description', 'The list of available commands in Theia.'),
41
- usedInPrompt: true
42
- }];
43
- }
44
- async getSystemMessageDescription(context) {
45
- const knownCommands = [];
46
- for (const command of this.commandRegistry.getAllCommands()) {
47
- knownCommands.push(`${command.id}: ${command.label}`);
48
- }
49
- const systemPrompt = await this.promptService.getResolvedPromptFragment(command_prompt_template_1.commandTemplate.id, {
50
- 'command-ids': knownCommands.join('\n')
51
- }, context);
52
- if (systemPrompt === undefined) {
53
- throw new Error('Couldn\'t get prompt ');
54
- }
55
- return chat_agents_1.SystemMessageDescription.fromResolvedPromptFragment(systemPrompt);
56
- }
57
- /**
58
- * @param text the text received from the language model
59
- * @returns the parsed command if the text contained a valid command.
60
- * If there was no json in the text, return a no-command response.
61
- */
62
- async parseTextResponse(text) {
63
- const jsonMatch = text.match(/(\{[\s\S]*\})/);
64
- const jsonString = jsonMatch ? jsonMatch[1] : `{
65
- "type": "no-command",
66
- "message": "Please try again."
67
- }`;
68
- const parsedCommand = JSON.parse(jsonString);
69
- return parsedCommand;
70
- }
71
- createResponseContent(parsedCommand, request) {
72
- var _a;
73
- if (parsedCommand.type === 'theia-command') {
74
- const theiaCommand = this.commandRegistry.getCommand(parsedCommand.commandId);
75
- if (theiaCommand === undefined) {
76
- console.error(`No Theia Command with id ${parsedCommand.commandId}`);
77
- request.cancel();
78
- }
79
- const args = parsedCommand.arguments !== undefined &&
80
- parsedCommand.arguments.length > 0
81
- ? parsedCommand.arguments
82
- : undefined;
83
- return new chat_model_1.HorizontalLayoutChatResponseContentImpl([
84
- new chat_model_1.MarkdownChatResponseContentImpl(core_1.nls.localize('theia/ai/ide/commandAgent/response/theiaCommand', 'I found this command that might help you:')),
85
- new chat_model_1.CommandChatResponseContentImpl(theiaCommand, undefined, args),
86
- ]);
87
- }
88
- else if (parsedCommand.type === 'custom-handler') {
89
- const id = `ai-command-${(0, core_1.generateUuid)()}`;
90
- const commandArgs = parsedCommand.arguments !== undefined && parsedCommand.arguments.length > 0 ? parsedCommand.arguments : [];
91
- const args = [id, ...commandArgs];
92
- const customCallback = {
93
- label: core_1.nls.localize('theia/ai/ide/commandAgent/commandCallback/label', 'AI command'),
94
- callback: () => this.commandCallback(...args),
95
- };
96
- return new chat_model_1.HorizontalLayoutChatResponseContentImpl([
97
- new chat_model_1.MarkdownChatResponseContentImpl(core_1.nls.localize('theia/ai/ide/commandAgent/response/customHandler', 'Try executing this:')),
98
- new chat_model_1.CommandChatResponseContentImpl(undefined, customCallback, args),
99
- ]);
100
- }
101
- else {
102
- return new chat_model_1.MarkdownChatResponseContentImpl((_a = parsedCommand.message) !== null && _a !== void 0 ? _a : core_1.nls.localize('theia/ai/ide/commandAgent/response/noCommand', 'Sorry, I can\'t find such a command'));
103
- }
104
- }
105
- async commandCallback(...commandArgs) {
106
- this.messageService.info(core_1.nls.localize('theia/ai/ide/commandAgent/commandCallback/message', 'Executing callback with args {0}. The first arg is the command id registered for the dynamically registered command. ' +
107
- 'The other args are the actual args for the handler.', commandArgs.join(', ')), core_1.nls.localize('theia/ai/ide/commandAgent/commandCallback/confirmAction', 'Got it'));
108
- }
109
- };
110
- exports.CommandChatAgent = CommandChatAgent;
111
- tslib_1.__decorate([
112
- (0, inversify_1.inject)(core_1.CommandRegistry),
113
- tslib_1.__metadata("design:type", core_1.CommandRegistry)
114
- ], CommandChatAgent.prototype, "commandRegistry", void 0);
115
- tslib_1.__decorate([
116
- (0, inversify_1.inject)(core_1.MessageService),
117
- tslib_1.__metadata("design:type", core_1.MessageService)
118
- ], CommandChatAgent.prototype, "messageService", void 0);
119
- exports.CommandChatAgent = CommandChatAgent = tslib_1.__decorate([
120
- (0, inversify_1.injectable)()
121
- ], CommandChatAgent);
122
- //# sourceMappingURL=command-chat-agents.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-chat-agents.js","sourceRoot":"","sources":["../../src/common/command-chat-agents.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,uEAAsH;AAEtH,qEAO8C;AAC9C,sCAKqB;AAErB,uEAA4D;AAUrD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,iDAAkD;IAAjF;;QAMH,OAAE,GAAW,SAAS,CAAC;QACvB,SAAI,GAAG,SAAS,CAAC;QACjB,8BAAyB,GAA+B,CAAC;gBACrD,OAAO,EAAE,SAAS;gBAClB,UAAU,EAAE,mBAAmB;aAClC,CAAC,CAAC;QACO,gCAA2B,GAAW,SAAS,CAAC;QAEjD,gBAAW,GAAG,UAAG,CAAC,QAAQ,CAAC,uCAAuC,EACvE,wIAAwI;YACxI,4FAA4F,CAAC,CAAC;QACzF,YAAO,GAAG,CAAC,yCAAe,CAAC,CAAC;QAC5B,2BAAsB,GAAG,CAAC;gBAC/B,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,UAAG,CAAC,QAAQ,CAAC,uDAAuD,EAAE,0CAA0C,CAAC;gBAC9H,YAAY,EAAE,IAAI;aACrB,CAAC,CAAC;IA0EP,CAAC;IAxEsB,KAAK,CAAC,2BAA2B,CAAC,OAA0B;QAC3E,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,EAAE,CAAC;YAC1D,aAAa,CAAC,I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Ae,CAAC,GAAG,WAAsB;QACrD,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAG,CAAC,QAAQ,CAAC,mDAAmD,EACrF,uHAAuH;YACvH,qDAAqD,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,UAAG,CAAC,QAAQ,CAAC,yDAAyD,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3K,CAAC;CACJ,CAAA;AAhGY,4CAAgB;AAEf;IADT,IAAA,kBAAM,EAAC,sBAAe,CAAC;sCACG,sBAAe;yDAAC;AAEjC;IADT,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACG,qBAAc;wDAAC;2BAJhC,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAgG5B"}
@@ -1,3 +0,0 @@
1
- import { PromptVariantSet } from '@theia/ai-core';
2
- export declare const commandTemplate: PromptVariantSet;
3
- //# sourceMappingURL=command-prompt-template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/command-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,gBAkN7B,CAAC"}