@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
@@ -0,0 +1,105 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
18
+ import { inject, injectable } from '@theia/core/shared/inversify';
19
+ import { PromptService } from '@theia/ai-core/lib/common';
20
+ import { nls } from '@theia/core';
21
+ import { AGENT_DELEGATION_FUNCTION_ID } from '@theia/ai-chat/lib/browser/agent-delegation-tool';
22
+
23
+ /**
24
+ * Contribution that registers the `/remember` slash command for AI chat agents.
25
+ *
26
+ * This command allows Architect and Coder agents to extract important topics
27
+ * from the current conversation and delegate to the ProjectInfo agent to update
28
+ * the persistent project context file.
29
+ */
30
+ @injectable()
31
+ export class RememberCommandContribution implements FrontendApplicationContribution {
32
+
33
+ @inject(PromptService)
34
+ protected readonly promptService: PromptService;
35
+
36
+ onStart(): void {
37
+ this.registerRememberCommand();
38
+ }
39
+
40
+ protected registerRememberCommand(): void {
41
+ const commandTemplate = this.buildCommandTemplate();
42
+
43
+ this.promptService.addBuiltInPromptFragment({
44
+ id: 'remember-conversation-context',
45
+ template: commandTemplate,
46
+ isCommand: true,
47
+ commandName: 'remember',
48
+ commandDescription: nls.localize(
49
+ 'theia/ai-ide/rememberCommand/description',
50
+ 'Extract topics from conversation and update project info'
51
+ ),
52
+ commandArgumentHint: nls.localize(
53
+ 'theia/ai-ide/rememberCommand/argumentHint',
54
+ '[topic-hint]'
55
+ ),
56
+ commandAgents: ['Architect', 'Coder']
57
+ });
58
+ }
59
+
60
+ protected buildCommandTemplate(): string {
61
+ return `You have been asked to extract and remember important information from the current conversation.
62
+
63
+ ## Task Overview
64
+ Review the conversation history and identify specific information that should be added to the persistent project context.
65
+
66
+ ## Focus Area
67
+ $ARGUMENTS
68
+
69
+ ## What to Extract
70
+ **If a focus area is provided above**: ONLY extract information related to that specific focus area. Ignore all other topics.
71
+
72
+ **If no focus area is provided**: Look specifically for information where the user had to correct you or provide clarification:
73
+ - **User corrections**: When the user corrected your assumptions about the codebase, architecture, or processes
74
+ - **User-provided context**: Information the user explicitly provided that you couldn't discover yourself
75
+ - **Project-specific knowledge**: Details about the project that the user shared when you made incorrect assumptions
76
+
77
+ **Do NOT extract**:
78
+ - General information you discovered through code analysis
79
+ - Standard coding practices you identified yourself
80
+ - Information you found by exploring the codebase
81
+ - Common knowledge or widely-known patterns
82
+ - Details that are already well-documented in the code
83
+
84
+ ## Instructions
85
+ 1. **Analyze the conversation**: Review messages for the specific criteria above
86
+ 2. **Extract only relevant information**: For each qualifying item, prepare a clear description that captures:
87
+ - What the user corrected or clarified
88
+ - Why your initial understanding was incomplete
89
+ - The specific project context that was provided
90
+ 3. **Delegate to ProjectInfo agent**: Use the ~{${AGENT_DELEGATION_FUNCTION_ID}} tool to send the extracted information to the ProjectInfo agent:
91
+ - Agent ID: 'ProjectInfo'
92
+ - Prompt: Ask the ProjectInfo agent to review the extracted information and update the project information file
93
+
94
+ ## Example Delegation
95
+ \`\`\`
96
+ Please review and incorporate the following user corrections/clarifications into the project context:
97
+
98
+ [Your extracted corrections and user-provided context here]
99
+
100
+ Update /.prompts/project-info.prompttemplate by adding this information to the appropriate sections. Focus on information that prevents future misunderstandings.
101
+ \`\`\`
102
+
103
+ Remember: Only extract information that prevents future AI agents from making the same mistakes or assumptions you made that were corrected by the user.`;
104
+ }
105
+ }
@@ -14,7 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
  import { ToolProvider, ToolRequest } from '@theia/ai-core';
17
- import { CancellationToken, Disposable, PreferenceService, URI } from '@theia/core';
17
+ import { CancellationToken, Disposable, PreferenceService, URI, Path } from '@theia/core';
18
18
  import { inject, injectable } from '@theia/core/shared/inversify';
19
19
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
20
20
  import { FileStat } from '@theia/filesystem/lib/common/files';
@@ -69,6 +69,73 @@ export class WorkspaceFunctionScope {
69
69
  return workspaceRoot.resolve(relativePath);
70
70
  }
71
71
 
72
+ isInWorkspace(uri: URI): boolean {
73
+ try {
74
+ const wsRoots = this.workspaceService.tryGetRoots();
75
+
76
+ if (wsRoots.length === 0) {
77
+ return false;
78
+ }
79
+
80
+ for (const root of wsRoots) {
81
+ const rootUri = root.resource;
82
+ if (rootUri.scheme === uri.scheme && rootUri.isEqualOrParent(uri)) {
83
+ return true;
84
+ }
85
+ }
86
+
87
+ return false;
88
+ } catch {
89
+ return false;
90
+ }
91
+ }
92
+
93
+ isInPrimaryWorkspace(uri: URI): boolean {
94
+ try {
95
+ const wsRoots = this.workspaceService.tryGetRoots();
96
+
97
+ if (wsRoots.length === 0) {
98
+ return false;
99
+ }
100
+
101
+ const primaryRoot = wsRoots[0].resource;
102
+ return primaryRoot.scheme === uri.scheme && primaryRoot.isEqualOrParent(uri);
103
+ } catch {
104
+ return false;
105
+ }
106
+ }
107
+
108
+ async resolveToUri(pathOrUri: string | URI): Promise<URI | undefined> {
109
+ if (pathOrUri instanceof URI) {
110
+ return pathOrUri;
111
+ }
112
+
113
+ if (!pathOrUri) {
114
+ return undefined;
115
+ }
116
+
117
+ if (pathOrUri.includes('://')) {
118
+ try {
119
+ const uri = new URI(pathOrUri);
120
+ return uri;
121
+ } catch (error) {
122
+ }
123
+ }
124
+
125
+ const normalizedPath = Path.normalizePathSeparator(pathOrUri);
126
+ const path = new Path(normalizedPath);
127
+
128
+ if (normalizedPath.includes('..')) {
129
+ return undefined;
130
+ }
131
+
132
+ if (path.isAbsolute) {
133
+ return URI.fromFilePath(normalizedPath);
134
+ }
135
+
136
+ return this.resolveRelativePath(normalizedPath);
137
+ }
138
+
72
139
  private async initializeGitignoreWatcher(workspaceRoot: URI): Promise<void> {
73
140
  if (this.gitignoreWatcherInitialized) {
74
141
  return;
@@ -48,7 +48,7 @@ export const aiIdePreferenceSchema: PreferenceSchema = {
48
48
  items: {
49
49
  type: 'string'
50
50
  },
51
- default: ['ClaudeCode'],
51
+ default: ['ClaudeCode', 'Codex'],
52
52
  }
53
53
  }
54
54
  };
@@ -28,8 +28,7 @@ import {
28
28
  SUGGEST_FILE_REPLACEMENTS_ID,
29
29
  WRITE_FILE_REPLACEMENTS_ID,
30
30
  CLEAR_FILE_CHANGES_ID,
31
- GET_PROPOSED_CHANGES_ID,
32
- SUGGEST_FILE_REPLACEMENTS_NEXT_ID
31
+ GET_PROPOSED_CHANGES_ID
33
32
  } from './file-changeset-function-ids';
34
33
 
35
34
  export const CODER_SYSTEM_PROMPT_ID = 'coder-system';
@@ -161,7 +160,7 @@ You are an autonomous AI agent. Do not stop until:
161
160
  };
162
161
  }
163
162
 
164
- function getCoderEditPromptTemplate(suggestFileReplacementsId: string): string {
163
+ function getCoderEditPromptTemplate(): string {
165
164
  return `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
166
165
  Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
167
166
  https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
@@ -189,9 +188,9 @@ This also applies for newly created files!
189
188
  - **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
190
189
  - **View Pending Changes**: Use ~{${GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
191
190
  - **Change Content**: Use one of these methods to propose changes:
192
- - ~{${suggestFileReplacementsId}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
193
- - ~{${SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
194
- - If ~{${suggestFileReplacementsId}} continuously fails use ~{${SUGGEST_FILE_CONTENT_ID}}.
191
+ - ~{${SUGGEST_FILE_REPLACEMENTS_ID}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
192
+ - ~{${SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
193
+ - If ~{${SUGGEST_FILE_REPLACEMENTS_ID}} continuously fails use ~{${SUGGEST_FILE_CONTENT_ID}}.
195
194
  - ~{${CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
196
195
 
197
196
  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 \
@@ -235,14 +234,14 @@ You have previously proposed changes for the following files. Some suggestions m
235
234
  export function getCoderPromptTemplateEdit(): BasePromptFragment {
236
235
  return {
237
236
  id: CODER_EDIT_TEMPLATE_ID,
238
- template: getCoderEditPromptTemplate(SUGGEST_FILE_REPLACEMENTS_ID)
237
+ template: getCoderEditPromptTemplate()
239
238
  };
240
239
  }
241
-
240
+ // Currently, the next template is identical to the regular edit prompt
242
241
  export function getCoderPromptTemplateEditNext(): BasePromptFragment {
243
242
  return {
244
243
  id: CODER_EDIT_NEXT_TEMPLATE_ID,
245
- template: getCoderEditPromptTemplate(SUGGEST_FILE_REPLACEMENTS_NEXT_ID),
244
+ template: getCoderEditPromptTemplate(),
246
245
  ...({ variantOf: CODER_EDIT_TEMPLATE_ID })
247
246
  };
248
247
  }
@@ -33,25 +33,25 @@ Never under any circumstances may you reply with just the command-id!
33
33
 
34
34
  ## Example 1
35
35
 
36
- This reply is to tell the user to execute the \`theia-ai-prompt-template:show-prompts-command\` command that is available in the Theia command registry.
36
+ This reply is to tell the user to execute the \`preferences:open\` command that is available in the Theia command registry.
37
37
 
38
38
  \`\`\`json
39
39
  {
40
40
  "type": "theia-command",
41
- "commandId": "theia-ai-prompt-template:show-prompts-command"
41
+ "commandId": "preferences:open"
42
42
  }
43
43
  \`\`\`
44
44
 
45
45
  ## Example 2
46
46
 
47
- This reply is to tell the user to execute the \`theia-ai-prompt-template:show-prompts-command\` command that is available in the theia command registry,
47
+ This reply is to tell the user to execute the \`preferences:open\` command that is available in the Theia command registry,
48
48
  when the user want to pass arguments to the command.
49
49
 
50
50
  \`\`\`json
51
51
  {
52
52
  "type": "theia-command",
53
- "commandId": "theia-ai-prompt-template:show-prompts-command",
54
- "arguments": ["foo"]
53
+ "commandId": "preferences:open",
54
+ "arguments": ["ai-features"]
55
55
  }
56
56
  \`\`\`
57
57
 
@@ -16,8 +16,22 @@
16
16
 
17
17
  export const SUGGEST_FILE_CONTENT_ID = 'suggestFileContent';
18
18
  export const WRITE_FILE_CONTENT_ID = 'writeFileContent';
19
+
20
+ /**
21
+ * Default function ID for suggesting file replacements.
22
+ * Uses the improved content replacer implementation (V2) with better matching and error handling.
23
+ * This replaced the previous simpler implementation which is now available as SUGGEST_FILE_REPLACEMENTS_SIMPLE_ID.
24
+ */
19
25
  export const SUGGEST_FILE_REPLACEMENTS_ID = 'suggestFileReplacements';
26
+
27
+ /**
28
+ * Legacy function ID for suggesting file replacements.
29
+ * Uses the original content replacer implementation (V1).
30
+ * @deprecated This is the older implementation. Consider using SUGGEST_FILE_REPLACEMENTS_ID (default) instead.
31
+ * This implementation may be removed in a future version.
32
+ */
33
+ export const SUGGEST_FILE_REPLACEMENTS_SIMPLE_ID = 'suggestFileReplacements_Simple';
34
+
20
35
  export const WRITE_FILE_REPLACEMENTS_ID = 'writeFileReplacements';
21
36
  export const CLEAR_FILE_CHANGES_ID = 'clearFileChanges';
22
37
  export const GET_PROPOSED_CHANGES_ID = 'getProposedFileState';
23
- export const SUGGEST_FILE_REPLACEMENTS_NEXT_ID = 'suggestFileReplacements_Next';
@@ -64,7 +64,7 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent {
64
64
  return undefined;
65
65
  }
66
66
 
67
- const excludedAgents = this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
67
+ const excludedAgents = this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode', 'Codex']);
68
68
  const availableAgents = this.getAvailableAgentsForDelegation(excludedAgents);
69
69
  const availableChatAgentsValue = availableAgents.map(agent => prettyPrintAgentInMd(agent)).join('\n');
70
70
 
@@ -88,7 +88,7 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent {
88
88
  }
89
89
 
90
90
  protected getExcludedAgentIds(): string[] {
91
- return this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
91
+ return this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode', 'Codex']);
92
92
  }
93
93
 
94
94
  override async invoke(request: MutableChatRequestModel): Promise<void> {
@@ -1,41 +0,0 @@
1
- /// <reference types="react" />
2
- import { Agent, AgentService, AISettingsService, AIVariableService, FrontendLanguageModelRegistry, LanguageModel, PromptFragmentCustomizationService, PromptService } from '@theia/ai-core/lib/common';
3
- import { QuickInputService, ReactWidget } from '@theia/core/lib/browser';
4
- import * as React from '@theia/core/shared/react';
5
- import { AIConfigurationSelectionService } from './ai-configuration-service';
6
- import { LanguageModelAliasRegistry, LanguageModelAlias } from '@theia/ai-core/lib/common/language-model-alias';
7
- interface ParsedPrompt {
8
- functions: string[];
9
- globalVariables: string[];
10
- agentSpecificVariables: string[];
11
- }
12
- export declare class AIAgentConfigurationWidget extends ReactWidget {
13
- static readonly ID = "ai-agent-configuration-container-widget";
14
- static readonly LABEL: string;
15
- protected readonly agentService: AgentService;
16
- protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
17
- protected readonly promptFragmentCustomizationService: PromptFragmentCustomizationService;
18
- protected readonly languageModelAliasRegistry: LanguageModelAliasRegistry;
19
- protected readonly aiSettingsService: AISettingsService;
20
- protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
21
- protected readonly variableService: AIVariableService;
22
- protected promptService: PromptService;
23
- protected readonly quickInputService: QuickInputService;
24
- protected languageModels: LanguageModel[] | undefined;
25
- protected languageModelAliases: LanguageModelAlias[];
26
- protected parsedPromptParts: ParsedPrompt | undefined;
27
- protected isLoadingDetails: boolean;
28
- protected init(): void;
29
- protected updateParsedPromptParts(): Promise<void>;
30
- protected render(): React.ReactNode;
31
- protected renderAgentName(agent: Agent): React.ReactNode;
32
- protected renderAgentDetails(): React.ReactNode;
33
- protected parsePromptFragmentsForVariableAndFunction(agent: Agent): Promise<ParsedPrompt>;
34
- protected extractVariablesAndFunctions(promptContent: string, result: ParsedPrompt, agent: Agent): void;
35
- protected showVariableConfigurationTab(): void;
36
- protected addCustomAgent(): Promise<void>;
37
- protected setActiveAgent(agent: Agent): void;
38
- private toggleAgentEnabled;
39
- }
40
- export {};
41
- //# sourceMappingURL=agent-configuration-widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/agent-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EACH,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,aAAa,EAIb,kCAAkC,EAClC,aAAa,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGlF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAKhH,UAAU,YAAY;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,sBAAsB,EAAE,MAAM,EAAE,CAAC;CACpC;AAED,qBACa,0BAA2B,SAAQ,WAAW;IAEvD,MAAM,CAAC,QAAQ,CAAC,EAAE,6CAA6C;IAC/D,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAoE;IAGzF,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAGxE,SAAS,CAAC,QAAQ,CAAC,kCAAkC,EAAE,kCAAkC,CAAC;IAG1F,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAGpF,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAGtD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,SAAS,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,CAAM;IAC1D,SAAS,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,gBAAgB,UAAS;IAGnC,SAAS,CAAC,IAAI,IAAI,IAAI;cA0CN,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYxD,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IA2BnC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS;IAKxD,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,SAAS;cA0F/B,0CAA0C,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB/F,SAAS,CAAC,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IA2BvG,SAAS,CAAC,4BAA4B,IAAI,IAAI;cAI9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC/C,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,OAAO,CAAC,kBAAkB,CAYxB;CACL"}