@theia/ai-ide 1.75.0-next.8 → 1.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (509) hide show
  1. package/lib/browser/ai-allow-all-mode-chat-banner.js +2 -20
  2. package/lib/browser/ai-allow-all-mode-chat-banner.js.map +1 -1
  3. package/lib/browser/ai-configuration/agent-icon.d.ts +16 -0
  4. package/lib/browser/ai-configuration/agent-icon.d.ts.map +1 -0
  5. package/lib/browser/ai-configuration/agent-icon.js +38 -0
  6. package/lib/browser/ai-configuration/agent-icon.js.map +1 -0
  7. package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.d.ts +36 -0
  8. package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.d.ts.map +1 -0
  9. package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.js +163 -0
  10. package/lib/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.js.map +1 -0
  11. package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts +50 -0
  12. package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts.map +1 -0
  13. package/lib/browser/ai-configuration/ai-configuration-detail-widget.js +208 -0
  14. package/lib/browser/ai-configuration/ai-configuration-detail-widget.js.map +1 -0
  15. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.d.ts +2 -0
  16. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.d.ts.map +1 -0
  17. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js +139 -0
  18. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js.map +1 -0
  19. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.d.ts +13 -0
  20. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.d.ts.map +1 -0
  21. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js +48 -0
  22. package/lib/browser/ai-configuration/ai-configuration-label-provider-contribution.js.map +1 -0
  23. package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.d.ts +22 -0
  24. package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.d.ts.map +1 -0
  25. package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.js +72 -0
  26. package/lib/browser/ai-configuration/ai-configuration-open-preference-renderer.js.map +1 -0
  27. package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.d.ts +2 -0
  28. package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.d.ts.map +1 -0
  29. package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.js +126 -0
  30. package/lib/browser/ai-configuration/ai-configuration-preference-ownership.spec.js.map +1 -0
  31. package/lib/browser/ai-configuration/ai-configuration-resource.d.ts +10 -0
  32. package/lib/browser/ai-configuration/ai-configuration-resource.d.ts.map +1 -0
  33. package/lib/browser/ai-configuration/{components/configuration-section.js → ai-configuration-resource.js} +11 -11
  34. package/lib/browser/ai-configuration/ai-configuration-resource.js.map +1 -0
  35. package/lib/browser/ai-configuration/ai-configuration-search-widget.d.ts +29 -0
  36. package/lib/browser/ai-configuration/ai-configuration-search-widget.d.ts.map +1 -0
  37. package/lib/browser/ai-configuration/ai-configuration-search-widget.js +106 -0
  38. package/lib/browser/ai-configuration/ai-configuration-search-widget.js.map +1 -0
  39. package/lib/browser/ai-configuration/ai-configuration-search.d.ts +18 -0
  40. package/lib/browser/ai-configuration/ai-configuration-search.d.ts.map +1 -0
  41. package/lib/browser/ai-configuration/ai-configuration-search.js +45 -0
  42. package/lib/browser/ai-configuration/ai-configuration-search.js.map +1 -0
  43. package/lib/browser/ai-configuration/ai-configuration-search.spec.d.ts +2 -0
  44. package/lib/browser/ai-configuration/ai-configuration-search.spec.d.ts.map +1 -0
  45. package/lib/browser/ai-configuration/ai-configuration-search.spec.js +79 -0
  46. package/lib/browser/ai-configuration/ai-configuration-search.spec.js.map +1 -0
  47. package/lib/browser/ai-configuration/ai-configuration-tree-model.d.ts +8 -0
  48. package/lib/browser/ai-configuration/ai-configuration-tree-model.d.ts.map +1 -0
  49. package/lib/browser/ai-configuration/{base/ai-configuration-base-widget.js → ai-configuration-tree-model.js} +11 -14
  50. package/lib/browser/ai-configuration/ai-configuration-tree-model.js.map +1 -0
  51. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.d.ts +57 -0
  52. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.d.ts.map +1 -0
  53. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.js +134 -0
  54. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.js.map +1 -0
  55. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.d.ts +2 -0
  56. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.d.ts.map +1 -0
  57. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.js +134 -0
  58. package/lib/browser/ai-configuration/ai-configuration-tree-nodes.spec.js.map +1 -0
  59. package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts +96 -0
  60. package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts.map +1 -0
  61. package/lib/browser/ai-configuration/ai-configuration-tree-widget.js +407 -0
  62. package/lib/browser/ai-configuration/ai-configuration-tree-widget.js.map +1 -0
  63. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +38 -4
  64. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -1
  65. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +151 -19
  66. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
  67. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +21 -23
  68. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -1
  69. package/lib/browser/ai-configuration/ai-configuration-widget.js +102 -70
  70. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -1
  71. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts +56 -0
  72. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts.map +1 -0
  73. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js +195 -0
  74. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js.map +1 -0
  75. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.d.ts +2 -0
  76. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.d.ts.map +1 -0
  77. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js +140 -0
  78. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.spec.js.map +1 -0
  79. package/lib/browser/ai-configuration/categories/agent-chips.d.ts +15 -0
  80. package/lib/browser/ai-configuration/categories/agent-chips.d.ts.map +1 -0
  81. package/lib/browser/ai-configuration/categories/agent-chips.js +19 -0
  82. package/lib/browser/ai-configuration/categories/agent-chips.js.map +1 -0
  83. package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts +37 -0
  84. package/lib/browser/ai-configuration/categories/agent-detail-model.d.ts.map +1 -0
  85. package/lib/browser/ai-configuration/categories/agent-detail-model.js +99 -0
  86. package/lib/browser/ai-configuration/categories/agent-detail-model.js.map +1 -0
  87. package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts +28 -0
  88. package/lib/browser/ai-configuration/categories/agent-detail-view.d.ts.map +1 -0
  89. package/lib/browser/ai-configuration/categories/agent-detail-view.js +135 -0
  90. package/lib/browser/ai-configuration/categories/agent-detail-view.js.map +1 -0
  91. package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts +78 -0
  92. package/lib/browser/ai-configuration/categories/agents-configuration-category.d.ts.map +1 -0
  93. package/lib/browser/ai-configuration/categories/agents-configuration-category.js +352 -0
  94. package/lib/browser/ai-configuration/categories/agents-configuration-category.js.map +1 -0
  95. package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.d.ts +2 -0
  96. package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.d.ts.map +1 -0
  97. package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.js +99 -0
  98. package/lib/browser/ai-configuration/categories/agents-configuration-category.spec.js.map +1 -0
  99. package/lib/browser/ai-configuration/categories/general-configuration-category.d.ts +93 -0
  100. package/lib/browser/ai-configuration/categories/general-configuration-category.d.ts.map +1 -0
  101. package/lib/browser/ai-configuration/categories/general-configuration-category.js +313 -0
  102. package/lib/browser/ai-configuration/categories/general-configuration-category.js.map +1 -0
  103. package/lib/browser/ai-configuration/categories/general-configuration-category.spec.d.ts +2 -0
  104. package/lib/browser/ai-configuration/categories/general-configuration-category.spec.d.ts.map +1 -0
  105. package/lib/browser/ai-configuration/categories/general-configuration-category.spec.js +213 -0
  106. package/lib/browser/ai-configuration/categories/general-configuration-category.spec.js.map +1 -0
  107. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts +53 -0
  108. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts.map +1 -0
  109. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js +241 -0
  110. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js.map +1 -0
  111. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.d.ts +2 -0
  112. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.d.ts.map +1 -0
  113. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js +75 -0
  114. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js.map +1 -0
  115. package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts +72 -0
  116. package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts.map +1 -0
  117. package/lib/browser/ai-configuration/categories/models-configuration-category.js +227 -0
  118. package/lib/browser/ai-configuration/categories/models-configuration-category.js.map +1 -0
  119. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.d.ts +2 -0
  120. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.d.ts.map +1 -0
  121. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js +145 -0
  122. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js.map +1 -0
  123. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.d.ts +114 -0
  124. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.d.ts.map +1 -0
  125. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.js +341 -0
  126. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.js.map +1 -0
  127. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.d.ts +2 -0
  128. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.d.ts.map +1 -0
  129. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.js +199 -0
  130. package/lib/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.js.map +1 -0
  131. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.d.ts +84 -0
  132. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.d.ts.map +1 -0
  133. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.js +341 -0
  134. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.js.map +1 -0
  135. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.d.ts +2 -0
  136. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.d.ts.map +1 -0
  137. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.js +184 -0
  138. package/lib/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.js.map +1 -0
  139. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.d.ts +38 -0
  140. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.d.ts.map +1 -0
  141. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js +130 -0
  142. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.js.map +1 -0
  143. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.d.ts +2 -0
  144. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.d.ts.map +1 -0
  145. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.js +51 -0
  146. package/lib/browser/ai-configuration/categories/token-usage-configuration-category.spec.js.map +1 -0
  147. package/lib/browser/ai-configuration/categories/tools-configuration-category.d.ts +60 -0
  148. package/lib/browser/ai-configuration/categories/tools-configuration-category.d.ts.map +1 -0
  149. package/lib/browser/ai-configuration/categories/tools-configuration-category.js +302 -0
  150. package/lib/browser/ai-configuration/categories/tools-configuration-category.js.map +1 -0
  151. package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.d.ts +2 -0
  152. package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.d.ts.map +1 -0
  153. package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.js +111 -0
  154. package/lib/browser/ai-configuration/categories/tools-configuration-category.spec.js.map +1 -0
  155. package/lib/browser/ai-configuration/categories/variables-configuration-category.d.ts +72 -0
  156. package/lib/browser/ai-configuration/categories/variables-configuration-category.d.ts.map +1 -0
  157. package/lib/browser/ai-configuration/categories/variables-configuration-category.js +245 -0
  158. package/lib/browser/ai-configuration/categories/variables-configuration-category.js.map +1 -0
  159. package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.d.ts +2 -0
  160. package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.d.ts.map +1 -0
  161. package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.js +131 -0
  162. package/lib/browser/ai-configuration/categories/variables-configuration-category.spec.js.map +1 -0
  163. package/lib/browser/ai-configuration/components/agent-notification-settings.d.ts +6 -2
  164. package/lib/browser/ai-configuration/components/agent-notification-settings.d.ts.map +1 -1
  165. package/lib/browser/ai-configuration/components/agent-notification-settings.js +15 -21
  166. package/lib/browser/ai-configuration/components/agent-notification-settings.js.map +1 -1
  167. package/lib/browser/ai-configuration/language-model-renderer.d.ts +25 -1
  168. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
  169. package/lib/browser/ai-configuration/language-model-renderer.js +159 -63
  170. package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
  171. package/lib/browser/ai-configuration/language-model-renderer.spec.d.ts +2 -0
  172. package/lib/browser/ai-configuration/language-model-renderer.spec.d.ts.map +1 -0
  173. package/lib/browser/ai-configuration/language-model-renderer.spec.js +93 -0
  174. package/lib/browser/ai-configuration/language-model-renderer.spec.js.map +1 -0
  175. package/lib/browser/ai-sessions-widget.js +12 -16
  176. package/lib/browser/ai-sessions-widget.js.map +1 -1
  177. package/lib/browser/app-tester-chat-agent.d.ts +2 -0
  178. package/lib/browser/app-tester-chat-agent.d.ts.map +1 -1
  179. package/lib/browser/app-tester-chat-agent.js +5 -0
  180. package/lib/browser/app-tester-chat-agent.js.map +1 -1
  181. package/lib/browser/architect-agent.d.ts +2 -0
  182. package/lib/browser/architect-agent.d.ts.map +1 -1
  183. package/lib/browser/architect-agent.js +5 -0
  184. package/lib/browser/architect-agent.js.map +1 -1
  185. package/lib/browser/architect-prompt-template.d.ts.map +1 -1
  186. package/lib/browser/architect-prompt-template.js +7 -0
  187. package/lib/browser/architect-prompt-template.js.map +1 -1
  188. package/lib/browser/chat-session-item.d.ts.map +1 -1
  189. package/lib/browser/chat-session-item.js +17 -30
  190. package/lib/browser/chat-session-item.js.map +1 -1
  191. package/lib/browser/chat-session-list-components.js +7 -30
  192. package/lib/browser/chat-session-list-components.js.map +1 -1
  193. package/lib/browser/chat-session-list-service.d.ts +2 -1
  194. package/lib/browser/chat-session-list-service.d.ts.map +1 -1
  195. package/lib/browser/chat-session-list-service.js +6 -1
  196. package/lib/browser/chat-session-list-service.js.map +1 -1
  197. package/lib/browser/chat-sessions-welcome-message-provider.js +3 -21
  198. package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
  199. package/lib/browser/code-reviewer-agent.d.ts +2 -0
  200. package/lib/browser/code-reviewer-agent.d.ts.map +1 -1
  201. package/lib/browser/code-reviewer-agent.js +5 -0
  202. package/lib/browser/code-reviewer-agent.js.map +1 -1
  203. package/lib/browser/coder-agent.d.ts +2 -0
  204. package/lib/browser/coder-agent.d.ts.map +1 -1
  205. package/lib/browser/coder-agent.js +6 -1
  206. package/lib/browser/coder-agent.js.map +1 -1
  207. package/lib/browser/context-file-validation-service-impl.spec.js +2 -0
  208. package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -1
  209. package/lib/browser/create-skill-agent.d.ts +2 -0
  210. package/lib/browser/create-skill-agent.d.ts.map +1 -1
  211. package/lib/browser/create-skill-agent.js +5 -0
  212. package/lib/browser/create-skill-agent.js.map +1 -1
  213. package/lib/browser/explore-agent.d.ts +2 -0
  214. package/lib/browser/explore-agent.d.ts.map +1 -1
  215. package/lib/browser/explore-agent.js +5 -0
  216. package/lib/browser/explore-agent.js.map +1 -1
  217. package/lib/browser/file-changeset-functions.d.ts +7 -1
  218. package/lib/browser/file-changeset-functions.d.ts.map +1 -1
  219. package/lib/browser/file-changeset-functions.js +62 -20
  220. package/lib/browser/file-changeset-functions.js.map +1 -1
  221. package/lib/browser/file-changeset-functions.spec.js +130 -1
  222. package/lib/browser/file-changeset-functions.spec.js.map +1 -1
  223. package/lib/browser/frontend-module.d.ts.map +1 -1
  224. package/lib/browser/frontend-module.js +65 -59
  225. package/lib/browser/frontend-module.js.map +1 -1
  226. package/lib/browser/github-chat-agent.d.ts +2 -1
  227. package/lib/browser/github-chat-agent.d.ts.map +1 -1
  228. package/lib/browser/github-chat-agent.js +5 -0
  229. package/lib/browser/github-chat-agent.js.map +1 -1
  230. package/lib/browser/github-repo-variable-contribution.d.ts +2 -1
  231. package/lib/browser/github-repo-variable-contribution.d.ts.map +1 -1
  232. package/lib/browser/github-repo-variable-contribution.js +6 -1
  233. package/lib/browser/github-repo-variable-contribution.js.map +1 -1
  234. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -1
  235. package/lib/browser/ide-chat-welcome-message-provider.js +31 -118
  236. package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -1
  237. package/lib/browser/memory-capability-contribution.d.ts +8 -0
  238. package/lib/browser/memory-capability-contribution.d.ts.map +1 -0
  239. package/lib/browser/memory-capability-contribution.js +88 -0
  240. package/lib/browser/memory-capability-contribution.js.map +1 -0
  241. package/lib/browser/memory-capability-contribution.spec.d.ts +2 -0
  242. package/lib/browser/memory-capability-contribution.spec.d.ts.map +1 -0
  243. package/lib/browser/memory-capability-contribution.spec.js +74 -0
  244. package/lib/browser/memory-capability-contribution.spec.js.map +1 -0
  245. package/lib/browser/memory-directory-variable-contribution.d.ts +41 -0
  246. package/lib/browser/memory-directory-variable-contribution.d.ts.map +1 -0
  247. package/lib/browser/memory-directory-variable-contribution.js +107 -0
  248. package/lib/browser/memory-directory-variable-contribution.js.map +1 -0
  249. package/lib/browser/memory-directory-variable-contribution.spec.d.ts +2 -0
  250. package/lib/browser/memory-directory-variable-contribution.spec.d.ts.map +1 -0
  251. package/lib/browser/memory-directory-variable-contribution.spec.js +98 -0
  252. package/lib/browser/memory-directory-variable-contribution.spec.js.map +1 -0
  253. package/lib/browser/open-editors-hint-contribution.d.ts +7 -0
  254. package/lib/browser/open-editors-hint-contribution.d.ts.map +1 -0
  255. package/lib/browser/open-editors-hint-contribution.js +43 -0
  256. package/lib/browser/open-editors-hint-contribution.js.map +1 -0
  257. package/lib/browser/project-info-agent.d.ts +2 -0
  258. package/lib/browser/project-info-agent.d.ts.map +1 -1
  259. package/lib/browser/project-info-agent.js +5 -0
  260. package/lib/browser/project-info-agent.js.map +1 -1
  261. package/lib/browser/review/pr-review-agent.d.ts +2 -0
  262. package/lib/browser/review/pr-review-agent.d.ts.map +1 -1
  263. package/lib/browser/review/pr-review-agent.js +5 -0
  264. package/lib/browser/review/pr-review-agent.js.map +1 -1
  265. package/lib/browser/summarize-session-command-contribution.d.ts +2 -1
  266. package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -1
  267. package/lib/browser/summarize-session-command-contribution.js +6 -1
  268. package/lib/browser/summarize-session-command-contribution.js.map +1 -1
  269. package/lib/browser/task-context-file-storage-service.d.ts.map +1 -1
  270. package/lib/browser/task-context-file-storage-service.js +1 -0
  271. package/lib/browser/task-context-file-storage-service.js.map +1 -1
  272. package/lib/browser/todo-tool-renderer.js +11 -19
  273. package/lib/browser/todo-tool-renderer.js.map +1 -1
  274. package/lib/browser/user-interaction-tool-renderer.js +39 -83
  275. package/lib/browser/user-interaction-tool-renderer.js.map +1 -1
  276. package/lib/browser/user-interaction-tool.d.ts +2 -0
  277. package/lib/browser/user-interaction-tool.d.ts.map +1 -1
  278. package/lib/browser/user-interaction-tool.js +7 -1
  279. package/lib/browser/user-interaction-tool.js.map +1 -1
  280. package/lib/browser/user-interaction-tool.spec.js +4 -2
  281. package/lib/browser/user-interaction-tool.spec.js.map +1 -1
  282. package/lib/browser/workspace-functions.d.ts +45 -7
  283. package/lib/browser/workspace-functions.d.ts.map +1 -1
  284. package/lib/browser/workspace-functions.js +108 -70
  285. package/lib/browser/workspace-functions.js.map +1 -1
  286. package/lib/browser/workspace-functions.spec.js +139 -9
  287. package/lib/browser/workspace-functions.spec.js.map +1 -1
  288. package/lib/browser/workspace-launch-provider.spec.js +3 -0
  289. package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
  290. package/lib/browser/workspace-search-provider.d.ts.map +1 -1
  291. package/lib/browser/workspace-search-provider.js +4 -7
  292. package/lib/browser/workspace-search-provider.js.map +1 -1
  293. package/lib/browser/workspace-search-provider.spec.js +1 -2
  294. package/lib/browser/workspace-search-provider.spec.js.map +1 -1
  295. package/lib/browser/workspace-task-provider.spec.js +4 -0
  296. package/lib/browser/workspace-task-provider.spec.js.map +1 -1
  297. package/lib/common/coder-replace-prompt-template.d.ts +0 -2
  298. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
  299. package/lib/common/coder-replace-prompt-template.js +10 -11
  300. package/lib/common/coder-replace-prompt-template.js.map +1 -1
  301. package/lib/common/command-chat-agents.d.ts +2 -1
  302. package/lib/common/command-chat-agents.d.ts.map +1 -1
  303. package/lib/common/command-chat-agents.js +6 -1
  304. package/lib/common/command-chat-agents.js.map +1 -1
  305. package/lib/common/open-editors-hint-fragment-id.d.ts +2 -0
  306. package/lib/common/open-editors-hint-fragment-id.d.ts.map +1 -0
  307. package/lib/{browser/ai-configuration/components/empty-state.js → common/open-editors-hint-fragment-id.js} +5 -11
  308. package/lib/common/open-editors-hint-fragment-id.js.map +1 -0
  309. package/lib/common/orchestrator-chat-agent.d.ts +2 -1
  310. package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
  311. package/lib/common/orchestrator-chat-agent.js +5 -0
  312. package/lib/common/orchestrator-chat-agent.js.map +1 -1
  313. package/lib/common/universal-chat-agent.d.ts +2 -0
  314. package/lib/common/universal-chat-agent.d.ts.map +1 -1
  315. package/lib/common/universal-chat-agent.js +5 -0
  316. package/lib/common/universal-chat-agent.js.map +1 -1
  317. package/lib/common/universal-prompt-template.d.ts.map +1 -1
  318. package/lib/common/universal-prompt-template.js +3 -0
  319. package/lib/common/universal-prompt-template.js.map +1 -1
  320. package/lib/common/workspace-preferences.js +2 -2
  321. package/lib/common/workspace-preferences.js.map +1 -1
  322. package/lib/common/workspace-search-provider-util.d.ts +2 -1
  323. package/lib/common/workspace-search-provider-util.d.ts.map +1 -1
  324. package/lib/common/workspace-search-provider-util.js +3 -2
  325. package/lib/common/workspace-search-provider-util.js.map +1 -1
  326. package/lib/common/workspace-search-provider-util.spec.d.ts +2 -0
  327. package/lib/common/workspace-search-provider-util.spec.d.ts.map +1 -0
  328. package/lib/common/workspace-search-provider-util.spec.js +55 -0
  329. package/lib/common/workspace-search-provider-util.spec.js.map +1 -0
  330. package/lib/node/github-repo-service-impl.d.ts +2 -0
  331. package/lib/node/github-repo-service-impl.d.ts.map +1 -1
  332. package/lib/node/github-repo-service-impl.js +7 -1
  333. package/lib/node/github-repo-service-impl.js.map +1 -1
  334. package/package.json +26 -25
  335. package/src/browser/ai-configuration/agent-icon.ts +37 -0
  336. package/src/browser/ai-configuration/ai-configuration-breadcrumbs-contribution.ts +164 -0
  337. package/src/browser/ai-configuration/ai-configuration-detail-widget.spec.ts +165 -0
  338. package/src/browser/ai-configuration/ai-configuration-detail-widget.tsx +237 -0
  339. package/src/browser/ai-configuration/ai-configuration-label-provider-contribution.ts +47 -0
  340. package/src/browser/ai-configuration/ai-configuration-open-preference-renderer.ts +64 -0
  341. package/src/browser/ai-configuration/ai-configuration-preference-ownership.spec.ts +135 -0
  342. package/src/browser/ai-configuration/{components/configuration-section.tsx → ai-configuration-resource.ts} +9 -19
  343. package/src/browser/ai-configuration/ai-configuration-search-widget.tsx +135 -0
  344. package/src/browser/ai-configuration/ai-configuration-search.spec.ts +91 -0
  345. package/src/browser/ai-configuration/ai-configuration-search.ts +43 -0
  346. package/src/browser/ai-configuration/{components/empty-state.tsx → ai-configuration-tree-model.ts} +7 -11
  347. package/src/browser/ai-configuration/ai-configuration-tree-nodes.spec.ts +150 -0
  348. package/src/browser/ai-configuration/ai-configuration-tree-nodes.ts +167 -0
  349. package/src/browser/ai-configuration/ai-configuration-tree-widget.tsx +457 -0
  350. package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +156 -18
  351. package/src/browser/ai-configuration/ai-configuration-widget.tsx +107 -75
  352. package/src/browser/ai-configuration/categories/agent-capabilities-settings.spec.ts +161 -0
  353. package/src/browser/ai-configuration/categories/agent-capabilities-settings.tsx +340 -0
  354. package/src/browser/ai-configuration/categories/agent-chips.tsx +51 -0
  355. package/src/browser/ai-configuration/categories/agent-detail-model.ts +152 -0
  356. package/src/browser/ai-configuration/categories/agent-detail-view.tsx +329 -0
  357. package/src/browser/ai-configuration/categories/agents-configuration-category.spec.ts +119 -0
  358. package/src/browser/ai-configuration/categories/agents-configuration-category.tsx +431 -0
  359. package/src/browser/ai-configuration/categories/general-configuration-category.spec.ts +225 -0
  360. package/src/browser/ai-configuration/categories/general-configuration-category.tsx +465 -0
  361. package/src/browser/ai-configuration/categories/model-aliases-configuration-category.spec.ts +87 -0
  362. package/src/browser/ai-configuration/categories/model-aliases-configuration-category.tsx +286 -0
  363. package/src/browser/ai-configuration/categories/models-configuration-category.spec.ts +167 -0
  364. package/src/browser/ai-configuration/categories/models-configuration-category.tsx +264 -0
  365. package/src/browser/ai-configuration/categories/prompt-snippets-configuration-category.spec.ts +250 -0
  366. package/src/browser/ai-configuration/categories/prompt-snippets-configuration-category.tsx +438 -0
  367. package/src/browser/ai-configuration/categories/prompts-and-skills-configuration-category.spec.ts +226 -0
  368. package/src/browser/ai-configuration/categories/prompts-and-skills-configuration-category.tsx +419 -0
  369. package/src/browser/ai-configuration/categories/token-usage-configuration-category.spec.ts +57 -0
  370. package/src/browser/ai-configuration/categories/token-usage-configuration-category.tsx +185 -0
  371. package/src/browser/ai-configuration/categories/tools-configuration-category.spec.ts +130 -0
  372. package/src/browser/ai-configuration/categories/tools-configuration-category.tsx +421 -0
  373. package/src/browser/ai-configuration/categories/variables-configuration-category.spec.ts +154 -0
  374. package/src/browser/ai-configuration/categories/variables-configuration-category.tsx +322 -0
  375. package/src/browser/ai-configuration/components/agent-notification-settings.tsx +38 -33
  376. package/src/browser/ai-configuration/language-model-renderer.spec.ts +100 -0
  377. package/src/browser/ai-configuration/language-model-renderer.tsx +244 -100
  378. package/src/browser/app-tester-chat-agent.ts +5 -2
  379. package/src/browser/architect-agent.ts +5 -2
  380. package/src/browser/architect-prompt-template.ts +7 -0
  381. package/src/browser/chat-session-item.tsx +2 -4
  382. package/src/browser/chat-session-list-service.ts +6 -3
  383. package/src/browser/code-reviewer-agent.ts +5 -2
  384. package/src/browser/coder-agent.ts +7 -5
  385. package/src/browser/context-file-validation-service-impl.spec.ts +3 -2
  386. package/src/browser/create-skill-agent.ts +5 -2
  387. package/src/browser/explore-agent.ts +5 -2
  388. package/src/browser/file-changeset-functions.spec.ts +158 -5
  389. package/src/browser/file-changeset-functions.ts +61 -23
  390. package/src/browser/frontend-module.ts +76 -63
  391. package/src/browser/github-chat-agent.ts +5 -2
  392. package/src/browser/github-repo-variable-contribution.ts +6 -3
  393. package/src/browser/ide-chat-welcome-message-provider.tsx +11 -11
  394. package/src/browser/memory-capability-contribution.spec.ts +85 -0
  395. package/src/browser/memory-capability-contribution.ts +86 -0
  396. package/src/browser/memory-directory-variable-contribution.spec.ts +113 -0
  397. package/src/browser/memory-directory-variable-contribution.ts +113 -0
  398. package/src/browser/open-editors-hint-contribution.ts +38 -0
  399. package/src/browser/project-info-agent.ts +5 -2
  400. package/src/browser/review/pr-review-agent.ts +5 -2
  401. package/src/browser/style/ai-configuration-base.css +0 -6
  402. package/src/browser/style/ai-configuration-shell.css +416 -0
  403. package/src/browser/style/ai-configuration-table.css +2 -15
  404. package/src/browser/style/index.css +220 -276
  405. package/src/browser/summarize-session-command-contribution.ts +6 -3
  406. package/src/browser/task-context-file-storage-service.ts +5 -2
  407. package/src/browser/user-interaction-tool.spec.ts +5 -2
  408. package/src/browser/user-interaction-tool.ts +6 -2
  409. package/src/browser/workspace-functions.spec.ts +163 -10
  410. package/src/browser/workspace-functions.ts +121 -72
  411. package/src/browser/workspace-launch-provider.spec.ts +4 -1
  412. package/src/browser/workspace-search-provider.spec.ts +1 -2
  413. package/src/browser/workspace-search-provider.ts +4 -7
  414. package/src/browser/workspace-task-provider.spec.ts +5 -1
  415. package/src/common/coder-replace-prompt-template.ts +9 -9
  416. package/src/common/command-chat-agents.ts +6 -2
  417. package/src/{browser/ai-configuration/base/ai-configuration-base-widget.tsx → common/open-editors-hint-fragment-id.ts} +2 -22
  418. package/src/common/orchestrator-chat-agent.ts +5 -2
  419. package/src/common/universal-chat-agent.ts +5 -2
  420. package/src/common/universal-prompt-template.ts +3 -0
  421. package/src/common/workspace-preferences.ts +2 -2
  422. package/src/common/workspace-search-provider-util.spec.ts +61 -0
  423. package/src/common/workspace-search-provider-util.ts +3 -2
  424. package/src/node/github-repo-service-impl.ts +6 -2
  425. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +0 -72
  426. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +0 -1
  427. package/lib/browser/ai-configuration/agent-configuration-widget.js +0 -620
  428. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +0 -1
  429. package/lib/browser/ai-configuration/agent-configuration-widget.spec.d.ts +0 -2
  430. package/lib/browser/ai-configuration/agent-configuration-widget.spec.d.ts.map +0 -1
  431. package/lib/browser/ai-configuration/agent-configuration-widget.spec.js +0 -56
  432. package/lib/browser/ai-configuration/agent-configuration-widget.spec.js.map +0 -1
  433. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts +0 -31
  434. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts.map +0 -1
  435. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js +0 -55
  436. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js.map +0 -1
  437. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts +0 -13
  438. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts.map +0 -1
  439. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js.map +0 -1
  440. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts +0 -23
  441. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts.map +0 -1
  442. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js +0 -60
  443. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js.map +0 -1
  444. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts +0 -55
  445. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts.map +0 -1
  446. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js +0 -96
  447. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js.map +0 -1
  448. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts +0 -44
  449. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts.map +0 -1
  450. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js +0 -66
  451. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js.map +0 -1
  452. package/lib/browser/ai-configuration/components/configuration-section.d.ts +0 -12
  453. package/lib/browser/ai-configuration/components/configuration-section.d.ts.map +0 -1
  454. package/lib/browser/ai-configuration/components/configuration-section.js.map +0 -1
  455. package/lib/browser/ai-configuration/components/empty-state.d.ts +0 -10
  456. package/lib/browser/ai-configuration/components/empty-state.d.ts.map +0 -1
  457. package/lib/browser/ai-configuration/components/empty-state.js.map +0 -1
  458. package/lib/browser/ai-configuration/components/expandable-section.d.ts +0 -13
  459. package/lib/browser/ai-configuration/components/expandable-section.d.ts.map +0 -1
  460. package/lib/browser/ai-configuration/components/expandable-section.js +0 -31
  461. package/lib/browser/ai-configuration/components/expandable-section.js.map +0 -1
  462. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +0 -26
  463. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +0 -1
  464. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +0 -198
  465. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +0 -1
  466. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -140
  467. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +0 -1
  468. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -508
  469. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +0 -1
  470. package/lib/browser/ai-configuration/skills-configuration-widget.d.ts +0 -29
  471. package/lib/browser/ai-configuration/skills-configuration-widget.d.ts.map +0 -1
  472. package/lib/browser/ai-configuration/skills-configuration-widget.js +0 -166
  473. package/lib/browser/ai-configuration/skills-configuration-widget.js.map +0 -1
  474. package/lib/browser/ai-configuration/skills-configuration-widget.spec.d.ts +0 -2
  475. package/lib/browser/ai-configuration/skills-configuration-widget.spec.d.ts.map +0 -1
  476. package/lib/browser/ai-configuration/skills-configuration-widget.spec.js +0 -191
  477. package/lib/browser/ai-configuration/skills-configuration-widget.spec.js.map +0 -1
  478. package/lib/browser/ai-configuration/template-settings-renderer.d.ts +0 -9
  479. package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +0 -1
  480. package/lib/browser/ai-configuration/template-settings-renderer.js +0 -78
  481. package/lib/browser/ai-configuration/template-settings-renderer.js.map +0 -1
  482. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +0 -20
  483. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +0 -1
  484. package/lib/browser/ai-configuration/token-usage-configuration-widget.js +0 -170
  485. package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +0 -1
  486. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +0 -52
  487. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +0 -1
  488. package/lib/browser/ai-configuration/tools-configuration-widget.js +0 -357
  489. package/lib/browser/ai-configuration/tools-configuration-widget.js.map +0 -1
  490. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +0 -22
  491. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +0 -1
  492. package/lib/browser/ai-configuration/variable-configuration-widget.js +0 -133
  493. package/lib/browser/ai-configuration/variable-configuration-widget.js.map +0 -1
  494. package/src/browser/ai-configuration/agent-configuration-widget.spec.ts +0 -71
  495. package/src/browser/ai-configuration/agent-configuration-widget.tsx +0 -928
  496. package/src/browser/ai-configuration/base/ai-card-grid-configuration-widget.tsx +0 -72
  497. package/src/browser/ai-configuration/base/ai-hierarchical-configuration-widget.tsx +0 -51
  498. package/src/browser/ai-configuration/base/ai-list-detail-configuration-widget.tsx +0 -140
  499. package/src/browser/ai-configuration/base/ai-table-configuration-widget.tsx +0 -107
  500. package/src/browser/ai-configuration/components/expandable-section.tsx +0 -51
  501. package/src/browser/ai-configuration/model-aliases-configuration-widget.tsx +0 -270
  502. package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +0 -736
  503. package/src/browser/ai-configuration/skills-configuration-widget.spec.ts +0 -248
  504. package/src/browser/ai-configuration/skills-configuration-widget.tsx +0 -229
  505. package/src/browser/ai-configuration/template-settings-renderer.tsx +0 -125
  506. package/src/browser/ai-configuration/token-usage-configuration-widget.tsx +0 -214
  507. package/src/browser/ai-configuration/tools-configuration-widget.tsx +0 -544
  508. package/src/browser/ai-configuration/variable-configuration-widget.tsx +0 -159
  509. package/src/browser/style/ai-configuration-cards.css +0 -60
@@ -14,9 +14,11 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
  import { AiConfigurationService, ToolInvocationContext, ToolProvider, ToolRequest } from '@theia/ai-core';
17
- import { CancellationToken, Disposable, OS, PreferenceService, URI, Path } from '@theia/core';
17
+ import { ChatToolContext, FileReadTracker } from '@theia/ai-chat';
18
+ import { CancellationToken, Disposable, OS, PreferenceService, URI, Path, ILogger } from '@theia/core';
19
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
18
20
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
19
- import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
21
+ import { inject, injectable, named, optional, postConstruct } from '@theia/core/shared/inversify';
20
22
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
21
23
  import { FileStat, FileOperationError, FileOperationResult } from '@theia/filesystem/lib/common/files';
22
24
  import { FileSearchService } from '@theia/file-search/lib/common/file-search-service';
@@ -40,6 +42,22 @@ import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-mo
40
42
  import { ProblemManager } from '@theia/markers/lib/browser';
41
43
  import { DiagnosticSeverity, Range } from '@theia/core/shared/vscode-languageserver-protocol';
42
44
 
45
+ export const AccessibleRootContribution = Symbol('AccessibleRootContribution');
46
+
47
+ /**
48
+ * Contributes directories outside the workspace roots that the AI workspace tools may access, in
49
+ * addition to the user-configured `ai-features.workspaceFunctions.allowedExternalPaths`. This is meant
50
+ * for locations Theia owns and resolves itself, such as the memory store of the current workspace,
51
+ * whose path is generated and can therefore not be named in a preference by the user.
52
+ */
53
+ export interface AccessibleRootContribution {
54
+ /**
55
+ * The currently accessible roots. Queried on every check rather than once, so that a root which
56
+ * moves with the workspace is picked up without invalidation.
57
+ */
58
+ getRoots(): Promise<URI[]>;
59
+ }
60
+
43
61
  @injectable()
44
62
  export class WorkspaceFunctionScope {
45
63
  protected readonly GITIGNORE_FILE_NAME = '.gitignore';
@@ -59,6 +77,12 @@ export class WorkspaceFunctionScope {
59
77
  @inject(EnvVariablesServer)
60
78
  protected readonly envVariablesServer: EnvVariablesServer;
61
79
 
80
+ @inject(ILogger) @named('ai-ide:WorkspaceFunctionScope')
81
+ protected readonly logger: ILogger;
82
+
83
+ @inject(ContributionProvider) @named(AccessibleRootContribution) @optional()
84
+ protected readonly accessibleRootContributions: ContributionProvider<AccessibleRootContribution> | undefined;
85
+
62
86
  private gitignoreMatchers = new Map<string, ReturnType<typeof ignore> | undefined>();
63
87
  private gitignoreWatchersInitialized = new Set<string>();
64
88
 
@@ -115,7 +139,7 @@ export class WorkspaceFunctionScope {
115
139
  for (const root of sortedRoots) {
116
140
  const basename = root.resource.path.base;
117
141
  if (mapping.has(basename)) {
118
- console.debug(
142
+ this.logger.debug(
119
143
  `Multiple workspace roots share the basename '${basename}'. ` +
120
144
  `Only '${mapping.get(basename)!.toString()}' is addressable as '${basename}'. ` +
121
145
  `'${root.resource.toString()}' can still be accessed but may require full paths.`
@@ -298,20 +322,27 @@ export class WorkspaceFunctionScope {
298
322
 
299
323
  // ── Access control ──────────────────────────────────────────────────
300
324
 
301
- ensureWithinWorkspace(targetUri: URI, workspaceRootUri: URI): void {
302
- const normalized = targetUri.normalizePath();
303
- if (workspaceRootUri.scheme !== normalized.scheme
304
- || !workspaceRootUri.isEqualOrParent(normalized, WorkspaceFunctionScope.pathCaseSensitive)) {
305
- throw new Error('Access outside of the workspace is not allowed');
325
+ /**
326
+ * Resolves a tool argument and asserts that it may be accessed. This is the single entry point every
327
+ * tool uses, so that a path is subjected to the same parsing and the same boundary check no matter
328
+ * which tool received it.
329
+ *
330
+ * @throws if the path cannot be resolved or points outside the accessible roots.
331
+ */
332
+ async resolveAccessiblePath(pathOrUri: string): Promise<URI> {
333
+ const resolved = await this.resolveToUri(pathOrUri);
334
+ if (!resolved) {
335
+ throw new Error(`Invalid path: '${pathOrUri}'`);
306
336
  }
337
+ await this.ensureAccessible(resolved);
338
+ return resolved;
307
339
  }
308
340
 
309
341
  /**
310
- * Asserts the target URI is reachable by AI tools that honor the external
311
- * allow-list. Allowed when the URI is inside any workspace root, or when it
312
- * is covered by an entry of the `ai-features.workspaceFunctions.allowedExternalPaths`
313
- * preference. Workspace-scoped overrides of that preference are dropped when
314
- * the workspace is not trusted.
342
+ * Asserts the target URI is reachable by the AI tools. Allowed when the URI is inside any workspace
343
+ * root, below a root contributed by an {@link AccessibleRootContribution}, or covered by an entry of
344
+ * the `ai-features.workspaceFunctions.allowedExternalPaths` preference. Workspace-scoped overrides of
345
+ * that preference are dropped when the workspace is not trusted.
315
346
  *
316
347
  * The target URI is normalized before the check so that literal `..`
317
348
  * segments and percent-encoded equivalents (e.g. `%2e%2e`) are resolved
@@ -322,15 +353,9 @@ export class WorkspaceFunctionScope {
322
353
  */
323
354
  async ensureAccessible(targetUri: URI): Promise<void> {
324
355
  const normalized = targetUri.normalizePath();
325
- const caseSensitive = WorkspaceFunctionScope.pathCaseSensitive;
326
- const roots = this.getAllRootUris();
327
- for (const rootUri of roots) {
328
- if (rootUri.scheme === normalized.scheme && rootUri.isEqualOrParent(normalized, caseSensitive)) {
329
- return;
330
- }
331
- }
332
- const allowed = await this.getAllowedExternalUris();
333
- if (allowed.some(allowedUri => allowedUri.scheme === normalized.scheme && allowedUri.isEqualOrParent(normalized, caseSensitive))) {
356
+ if (this.isUnderAny(this.getAllRootUris(), normalized)
357
+ || this.isUnderAny(await this.getContributedRootUris(), normalized)
358
+ || this.isUnderAny(await this.getAllowedExternalUris(), normalized)) {
334
359
  return;
335
360
  }
336
361
  throw new Error(
@@ -339,6 +364,29 @@ export class WorkspaceFunctionScope {
339
364
  );
340
365
  }
341
366
 
367
+ protected isUnderAny(roots: URI[], normalizedTarget: URI): boolean {
368
+ const caseSensitive = WorkspaceFunctionScope.pathCaseSensitive;
369
+ return roots.some(root => root.scheme === normalizedTarget.scheme && root.isEqualOrParent(normalizedTarget, caseSensitive));
370
+ }
371
+
372
+ /**
373
+ * The roots contributed by {@link AccessibleRootContribution}s, normalized like the allow-list. A
374
+ * contribution that fails to resolve is skipped rather than allowed to fail every path check.
375
+ */
376
+ protected async getContributedRootUris(): Promise<URI[]> {
377
+ const roots: URI[] = [];
378
+ for (const contribution of this.accessibleRootContributions?.getContributions() ?? []) {
379
+ try {
380
+ for (const root of await contribution.getRoots()) {
381
+ roots.push(WorkspaceFunctionScope.withoutTrailingSeparator(root.normalizePath()));
382
+ }
383
+ } catch (error) {
384
+ this.logger.warn('Failed to resolve accessible roots from a contribution.', error);
385
+ }
386
+ }
387
+ return roots;
388
+ }
389
+
342
390
  isInWorkspace(uri: URI): boolean {
343
391
  try {
344
392
  const roots = this.getAllRootUris();
@@ -599,8 +647,8 @@ export class GetWorkspaceDirectoryStructure implements ToolProvider {
599
647
  name: GetWorkspaceDirectoryStructure.ID,
600
648
  description: 'Retrieves the directory tree structure as a nested JSON object. ' +
601
649
  'By default returns all workspace roots with root names as keys. ' +
602
- 'Pass `root` to inspect a specific directory listed in the ' +
603
- '`ai-features.workspaceFunctions.allowedExternalPaths` preference instead. ' +
650
+ 'Pass `root` to inspect a specific directory the tools may access, such as one listed in the ' +
651
+ '`ai-features.workspaceFunctions.allowedExternalPaths` preference, instead. ' +
604
652
  'Lists only directories (no files), excluding common non-essential directories (node_modules, hidden files, etc.). ' +
605
653
  'Useful for getting a high-level overview of project organization. ' +
606
654
  'For listing files within a specific directory, use getWorkspaceFileList instead. ' +
@@ -611,7 +659,7 @@ export class GetWorkspaceDirectoryStructure implements ToolProvider {
611
659
  root: {
612
660
  type: 'string',
613
661
  description: 'Optional absolute path or `file://` URI to inspect instead of the workspace. ' +
614
- 'Must be inside, or equal to, an entry of the `allowedExternalPaths` preference. ' +
662
+ 'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
615
663
  'When omitted, all workspace roots are returned.'
616
664
  }
617
665
  },
@@ -643,11 +691,7 @@ export class GetWorkspaceDirectoryStructure implements ToolProvider {
643
691
 
644
692
  try {
645
693
  if (root) {
646
- const resolved = await this.workspaceScope.resolveToUri(root);
647
- if (!resolved) {
648
- return { error: `Invalid root: '${root}'` };
649
- }
650
- await this.workspaceScope.ensureAccessible(resolved);
694
+ const resolved = await this.workspaceScope.resolveAccessiblePath(root);
651
695
  return this.buildDirectoryStructure(resolved, cancellationToken);
652
696
  } else {
653
697
  const rootMapping = this.workspaceScope.getRootMapping();
@@ -715,8 +759,8 @@ export class FileContentFunction implements ToolProvider {
715
759
  description: 'Returns the content of a specified file as a raw string. ' +
716
760
  'File paths use the same format returned by other workspace tools ' +
717
761
  '(e.g., "my-project/src/index.ts"). ' +
718
- 'Absolute paths and `file://` URIs are accepted when the target is inside the workspace ' +
719
- 'or covered by the `ai-features.workspaceFunctions.allowedExternalPaths` preference. ' +
762
+ 'Absolute paths and `file://` URIs are accepted when the target is a location the tools may access, ' +
763
+ 'such as a directory listed in the `ai-features.workspaceFunctions.allowedExternalPaths` preference. ' +
720
764
  'If the file is currently open in an editor with unsaved changes, returns the editor\'s current content (not the saved file on disk). ' +
721
765
  'Binary files may not be readable and will return an error. ' +
722
766
  'Use this tool to read file contents before making any edits with replacement functions. ' +
@@ -733,8 +777,8 @@ export class FileContentFunction implements ToolProvider {
733
777
  type: 'string',
734
778
  description: 'Path to the target file. May be workspace-relative ' +
735
779
  '(e.g., "my-project/src/index.ts"), an absolute path, or a `file://` URI. ' +
736
- 'Absolute / URI forms must point inside the workspace ' +
737
- 'or inside a directory listed in the `allowedExternalPaths` preference.',
780
+ 'Absolute / URI forms must point to a location the tools may access, such as a directory listed in the ' +
781
+ '`allowedExternalPaths` preference.',
738
782
  },
739
783
  offset: {
740
784
  type: 'number',
@@ -750,7 +794,7 @@ export class FileContentFunction implements ToolProvider {
750
794
  },
751
795
  handler: (arg_string: string, ctx?: ToolInvocationContext) => {
752
796
  const { file, offset, limit } = this.parseArg(arg_string);
753
- return this.getFileContent(file, ctx?.cancellationToken, offset, limit);
797
+ return this.getFileContent(file, ctx, offset, limit);
754
798
  },
755
799
  providerName: undefined,
756
800
  getArgumentsShortLabel: (args: string): { label: string; hasMore: boolean } | undefined => {
@@ -783,12 +827,17 @@ export class FileContentFunction implements ToolProvider {
783
827
  @inject(PreferenceService)
784
828
  protected readonly preferences: PreferenceService;
785
829
 
830
+ /** Optional: tracking is advisory, so containers without a tracker still get a working tool. */
831
+ @inject(FileReadTracker) @optional()
832
+ protected readonly fileReadTracker: FileReadTracker | undefined;
833
+
786
834
  private parseArg(arg_string: string): { file: string; offset?: number; limit?: number } {
787
835
  const result = JSON.parse(arg_string);
788
836
  return { file: result.file, offset: result.offset, limit: result.limit };
789
837
  }
790
838
 
791
- private async getFileContent(file: string, cancellationToken?: CancellationToken, offset?: number, limit?: number): Promise<string> {
839
+ private async getFileContent(file: string, ctx?: ToolInvocationContext, offset?: number, limit?: number): Promise<string> {
840
+ const cancellationToken = ctx?.cancellationToken;
792
841
  if (cancellationToken?.isCancellationRequested) {
793
842
  return JSON.stringify({ error: 'Operation cancelled by user' });
794
843
  }
@@ -800,14 +849,9 @@ export class FileContentFunction implements ToolProvider {
800
849
  return JSON.stringify({ error: 'limit must be a positive integer.' });
801
850
  }
802
851
 
803
- let targetUri: URI | undefined;
852
+ let targetUri: URI;
804
853
  try {
805
- const resolved = await this.workspaceScope.resolveToUri(file);
806
- if (!resolved) {
807
- return JSON.stringify({ error: `Invalid file path: '${file}'` });
808
- }
809
- targetUri = resolved;
810
- await this.workspaceScope.ensureAccessible(targetUri);
854
+ targetUri = await this.workspaceScope.resolveAccessiblePath(file);
811
855
  } catch (error) {
812
856
  return JSON.stringify({ error: error.message });
813
857
  }
@@ -822,20 +866,23 @@ export class FileContentFunction implements ToolProvider {
822
866
  const isPaginated = offset !== undefined || limit !== undefined;
823
867
 
824
868
  if (isEditorOpen) {
825
- return this.handleEditorContent(openEditorValue!, maxSizeKB, offset, limit);
869
+ return this.handleEditorContent(targetUri, openEditorValue!, maxSizeKB, ctx, offset, limit);
826
870
  } else if (isPaginated) {
827
871
  return this.readStreamedSlice(targetUri, maxSizeKB, offset, limit);
828
872
  } else {
829
- return this.handleFullDiskRead(targetUri, maxSizeKB);
873
+ return this.handleFullDiskRead(targetUri, maxSizeKB, ctx);
830
874
  }
831
875
  }
832
876
 
833
- private handleEditorContent(content: string, maxSizeKB: number, offset?: number, limit?: number): string {
877
+ private async handleEditorContent(
878
+ targetUri: URI, content: string, maxSizeKB: number, ctx?: ToolInvocationContext, offset?: number, limit?: number
879
+ ): Promise<string> {
834
880
  if (offset === undefined && limit === undefined) {
835
881
  const sizeKB = this.sizeInKB(content);
836
882
  if (sizeKB > maxSizeKB) {
837
883
  return this.buildFileSizeLimitError(sizeKB, maxSizeKB);
838
884
  }
885
+ await this.trackRead(targetUri, content, ctx);
839
886
  return content;
840
887
  }
841
888
 
@@ -853,7 +900,17 @@ export class FileContentFunction implements ToolProvider {
853
900
  return `${header}\n${result}`;
854
901
  }
855
902
 
856
- private async handleFullDiskRead(targetUri: URI, maxSizeKB: number): Promise<string> {
903
+ /**
904
+ * Remembers the content handed to the agent, if it came from a chat session at all. Only full reads are
905
+ * tracked: a slice says nothing about the rest of the file, so the streaming path is skipped.
906
+ */
907
+ private async trackRead(targetUri: URI, content: string, ctx?: ToolInvocationContext): Promise<void> {
908
+ if (ChatToolContext.is(ctx)) {
909
+ await this.fileReadTracker?.recordRead(ctx.request.session.id, targetUri, content);
910
+ }
911
+ }
912
+
913
+ private async handleFullDiskRead(targetUri: URI, maxSizeKB: number, ctx?: ToolInvocationContext): Promise<string> {
857
914
  try {
858
915
  const stat = await this.fileService.resolve(targetUri);
859
916
  if (stat.size !== undefined) {
@@ -872,6 +929,7 @@ export class FileContentFunction implements ToolProvider {
872
929
  if (sizeKB > maxSizeKB) {
873
930
  return this.buildFileSizeLimitError(sizeKB, maxSizeKB);
874
931
  }
932
+ await this.trackRead(targetUri, rawContent, ctx);
875
933
  return rawContent;
876
934
  } catch (error) {
877
935
  if (error instanceof FileOperationError) {
@@ -999,7 +1057,8 @@ export class GetWorkspaceFileList implements ToolProvider {
999
1057
  description: 'Path to a directory. Workspace-relative paths use the format \'rootName/path\' ' +
1000
1058
  '(e.g., \'my-project/src\', \'backend/src/components\'). ' +
1001
1059
  'Use \'\' or \'.\' to list the workspace top-level directories. ' +
1002
- 'Absolute paths and `file://` URIs are accepted when covered by the `allowedExternalPaths` preference.'
1060
+ 'Absolute paths and `file://` URIs are accepted when they point to a location the tools may access, ' +
1061
+ 'such as a directory listed in the `allowedExternalPaths` preference.'
1003
1062
  }
1004
1063
  },
1005
1064
  required: ['path']
@@ -1044,12 +1103,7 @@ export class GetWorkspaceFileList implements ToolProvider {
1044
1103
 
1045
1104
  let targetUri: URI;
1046
1105
  try {
1047
- const resolved = await this.workspaceScope.resolveToUri(path);
1048
- if (!resolved) {
1049
- return JSON.stringify({ error: `Invalid path: '${path}'` });
1050
- }
1051
- targetUri = resolved;
1052
- await this.workspaceScope.ensureAccessible(targetUri);
1106
+ targetUri = await this.workspaceScope.resolveAccessiblePath(path);
1053
1107
  } catch (error) {
1054
1108
  return JSON.stringify({ error: error.message });
1055
1109
  }
@@ -1107,6 +1161,9 @@ export class FileDiagnosticProvider implements ToolProvider {
1107
1161
  @inject(MonacoTextModelService)
1108
1162
  protected readonly modelService: MonacoTextModelService;
1109
1163
 
1164
+ @inject(ILogger) @named('ai-ide:FileDiagnosticProvider')
1165
+ protected readonly logger: ILogger;
1166
+
1110
1167
  getTool(): ToolRequest {
1111
1168
  return {
1112
1169
  id: FileDiagnosticProvider.ID,
@@ -1123,8 +1180,9 @@ export class FileDiagnosticProvider implements ToolProvider {
1123
1180
  properties: {
1124
1181
  file: {
1125
1182
  type: 'string',
1126
- description: 'The path to the target file within the workspace ' +
1127
- '(e.g., "my-project/src/index.ts", "backend/src/main.ts").'
1183
+ description: 'The path to the target file. May be workspace-relative ' +
1184
+ '(e.g., "my-project/src/index.ts", "backend/src/main.ts"), an absolute path, or a `file://` URI ' +
1185
+ 'pointing to a location the tools may access.'
1128
1186
  }
1129
1187
  },
1130
1188
  required: ['file']
@@ -1132,12 +1190,7 @@ export class FileDiagnosticProvider implements ToolProvider {
1132
1190
  handler: async (arg: string, ctx?: ToolInvocationContext) => {
1133
1191
  try {
1134
1192
  const { file } = JSON.parse(arg);
1135
- const targetUri = await this.workspaceScope.resolveRelativePath(file);
1136
- const containingRoot = this.workspaceScope.getContainingRoot(targetUri);
1137
- if (!containingRoot) {
1138
- return JSON.stringify({ error: 'Access outside of the workspace is not allowed' });
1139
- }
1140
- this.workspaceScope.ensureWithinWorkspace(targetUri, containingRoot);
1193
+ const targetUri = await this.workspaceScope.resolveAccessiblePath(file);
1141
1194
 
1142
1195
  return this.getDiagnosticsForFile(targetUri, ctx?.cancellationToken);
1143
1196
  } catch (error) {
@@ -1211,7 +1264,7 @@ export class FileDiagnosticProvider implements ToolProvider {
1211
1264
  if (err.message === 'Operation cancelled by user') {
1212
1265
  return JSON.stringify({ error: 'Operation cancelled by user' });
1213
1266
  }
1214
- console.warn('Error when fetching markers for', uri.toString(), err);
1267
+ this.logger.warn('Error when fetching markers for', uri.toString(), err);
1215
1268
  return JSON.stringify({ error: err instanceof Error ? err.message : 'Unknown error when fetching for problems for ' + uri.toString() });
1216
1269
  } finally {
1217
1270
  toDispose.forEach(disposable => disposable.dispose());
@@ -1262,8 +1315,8 @@ export class FindFilesByPattern implements ToolProvider {
1262
1315
  name: FindFilesByPattern.ID,
1263
1316
  description: 'Find files matching a given glob pattern. ' +
1264
1317
  'By default searches across all workspace roots. ' +
1265
- 'Pass `searchRoot` to search a directory listed in the ' +
1266
- '`ai-features.workspaceFunctions.allowedExternalPaths` preference instead. ' +
1318
+ 'Pass `searchRoot` to search a directory the tools may access, such as one listed in the ' +
1319
+ '`ai-features.workspaceFunctions.allowedExternalPaths` preference, instead. ' +
1267
1320
  'This function allows efficient discovery of files using patterns like \'**/*.ts\' for all TypeScript files or ' +
1268
1321
  '\'src/**/*.js\' for JavaScript files in the src directory. The function respects gitignore patterns and user exclusions, ' +
1269
1322
  'returns workspace-relative paths (e.g., "my-project/src/index.ts") or absolute paths for external roots, ' +
@@ -1288,7 +1341,7 @@ export class FindFilesByPattern implements ToolProvider {
1288
1341
  searchRoot: {
1289
1342
  type: 'string',
1290
1343
  description: 'Optional absolute path or `file://` URI to search instead of the workspace. ' +
1291
- 'Must be inside, or equal to, an entry of the `allowedExternalPaths` preference. ' +
1344
+ 'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
1292
1345
  'When set, results are returned as absolute paths so they can be passed back to getFileContent. ' +
1293
1346
  'When omitted (default), all workspace roots are searched and results are workspace-relative.'
1294
1347
  }
@@ -1337,11 +1390,7 @@ export class FindFilesByPattern implements ToolProvider {
1337
1390
  // Resolve the set of roots to search and how each root's results should be rendered.
1338
1391
  const targets: { rootUri: URI; rootName?: string; external: boolean }[] = [];
1339
1392
  if (searchRoot) {
1340
- const resolved = await this.workspaceScope.resolveToUri(searchRoot);
1341
- if (!resolved) {
1342
- return JSON.stringify({ error: `Invalid searchRoot: '${searchRoot}'` });
1343
- }
1344
- await this.workspaceScope.ensureAccessible(resolved);
1393
+ const resolved = await this.workspaceScope.resolveAccessiblePath(searchRoot);
1345
1394
  targets.push({ rootUri: resolved, external: !this.workspaceScope.isInWorkspace(resolved) });
1346
1395
  } else {
1347
1396
  const rootMapping = this.workspaceScope.getRootMapping();
@@ -1410,7 +1459,7 @@ export class FindFilesByPattern implements ToolProvider {
1410
1459
  */
1411
1460
  protected toDisplayPath(match: URI, target: { rootUri: URI; rootName?: string; external: boolean }): string | undefined {
1412
1461
  if (target.external) {
1413
- return match.path.toString();
1462
+ return match.path.fsPath();
1414
1463
  }
1415
1464
  const relativePath = target.rootUri.relative(match)?.toString();
1416
1465
  if (relativePath === undefined) {
@@ -20,7 +20,7 @@ import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/front
20
20
  FrontendApplicationConfigProvider.set({});
21
21
 
22
22
  import { expect } from 'chai';
23
- import { PreferenceService } from '@theia/core';
23
+ import { PreferenceService, ILogger } from '@theia/core';
24
24
  import URI from '@theia/core/lib/common/uri';
25
25
  import { Container } from '@theia/core/shared/inversify';
26
26
  import {
@@ -39,6 +39,7 @@ import { AiConfigurationService } from '@theia/ai-core';
39
39
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
40
40
  import { WorkspaceService } from '@theia/workspace/lib/browser';
41
41
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
42
+ import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
42
43
 
43
44
  const makeTrustAwareReader = (): AiConfigurationService => ({
44
45
  get: <T>(_name: string, fallback?: T) => fallback,
@@ -74,6 +75,7 @@ describe('Launch Management Tool Providers', () => {
74
75
 
75
76
  beforeEach(() => {
76
77
  container = new Container();
78
+ container.bind(ILogger).to(MockLogger).inSingletonScope();
77
79
 
78
80
  const mockWorkspaceService = {
79
81
  tryGetRoots: () => [
@@ -380,6 +382,7 @@ describe('Launch Management Tool Providers', () => {
380
382
  describe('Multi-root disambiguation', () => {
381
383
  it('should report ambiguity when same config name exists in multiple roots', async () => {
382
384
  const multiRootContainer = new Container();
385
+ multiRootContainer.bind(ILogger).to(MockLogger).inSingletonScope();
383
386
 
384
387
  const multiRootWorkspaceService = {
385
388
  tryGetRoots: () => [
@@ -62,8 +62,7 @@ describe('Workspace Search Provider Cancellation Tests', () => {
62
62
  const mockWorkspaceScope = {
63
63
  getRootMapping: () => new Map([['workspace', new URI('file:///workspace')]]),
64
64
  getContainingRoot: () => new URI('file:///workspace'),
65
- ensureWithinWorkspace: () => { },
66
- resolveRelativePath: (path: string) => new URI(`file:///workspace/${path}`)
65
+ resolveAccessiblePath: async (path: string) => new URI(`file:///workspace/${path}`)
67
66
  } as unknown as WorkspaceFunctionScope;
68
67
 
69
68
  const mockPreferenceService = {
@@ -75,8 +75,10 @@ export class WorkspaceSearchProvider implements ToolProvider {
75
75
  },
76
76
  subDirectoryPath: {
77
77
  type: 'string',
78
- description: 'Optional subdirectory path to limit search scope ' +
78
+ description: 'Optional directory to limit the search scope ' +
79
79
  '(e.g., "frontend/src", "backend/packages/core/src/browser"). ' +
80
+ 'May also be an absolute path or `file://` URI of a directory the AI tools may access, ' +
81
+ 'such as one listed in the `ai-features.workspaceFunctions.allowedExternalPaths` preference. ' +
80
82
  'If not specified, searches the entire workspace.'
81
83
  }
82
84
  },
@@ -96,12 +98,7 @@ export class WorkspaceSearchProvider implements ToolProvider {
96
98
  return Array.from(rootMapping.values()).map(uri => uri.toString());
97
99
  }
98
100
 
99
- const subDirUri = await this.workspaceScope.resolveRelativePath(subDirectoryPath);
100
- const containingRoot = this.workspaceScope.getContainingRoot(subDirUri);
101
- if (!containingRoot) {
102
- throw new Error(`Subdirectory '${subDirectoryPath}' is not within any workspace root`);
103
- }
104
- this.workspaceScope.ensureWithinWorkspace(subDirUri, containingRoot);
101
+ const subDirUri = await this.workspaceScope.resolveAccessiblePath(subDirectoryPath);
105
102
 
106
103
  try {
107
104
  const stat = await this.fileService.resolve(subDirUri);
@@ -15,7 +15,7 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { expect } from 'chai';
18
- import { CancellationTokenSource, PreferenceService } from '@theia/core';
18
+ import { CancellationTokenSource, PreferenceService, ILogger } from '@theia/core';
19
19
  import URI from '@theia/core/lib/common/uri';
20
20
  import { GLOBAL_SCOPE_TOKEN, TaskListProvider, TaskRunnerProvider, WORKSPACE_SCOPE_TOKEN } from './workspace-task-provider';
21
21
  import { AiConfigurationService, ToolInvocationContext } from '@theia/ai-core';
@@ -28,6 +28,7 @@ import { WorkspaceFunctionScope } from './workspace-functions';
28
28
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
29
29
  import { WorkspaceService } from '@theia/workspace/lib/browser';
30
30
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
31
+ import { MockLogger } from '@theia/core/lib/common/test/mock-logger';
31
32
 
32
33
  const makeTrustAwareReader = (): AiConfigurationService => ({
33
34
  get: <T>(_name: string, fallback?: T) => fallback,
@@ -60,6 +61,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
60
61
 
61
62
  // Create a new container for each test
62
63
  container = new Container();
64
+ container.bind(ILogger).to(MockLogger).inSingletonScope();
63
65
 
64
66
  // Mock dependencies
65
67
  mockTaskService = {
@@ -344,6 +346,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
344
346
  } as unknown as TaskService;
345
347
 
346
348
  const multiRootContainer = new Container();
349
+ multiRootContainer.bind(ILogger).to(MockLogger).inSingletonScope();
347
350
  const multiRootWorkspaceService = {
348
351
  tryGetRoots: () => [
349
352
  { resource: new URI('file:///home/user/frontend') },
@@ -391,6 +394,7 @@ describe('Workspace Task Provider Cancellation Tests', () => {
391
394
  } as unknown as TaskService;
392
395
 
393
396
  const multiRootContainer = new Container();
397
+ multiRootContainer.bind(ILogger).to(MockLogger).inSingletonScope();
394
398
  const multiRootWorkspaceService = {
395
399
  tryGetRoots: () => [
396
400
  { resource: new URI('file:///home/user/frontend') },
@@ -36,11 +36,11 @@ import {
36
36
  } from './file-changeset-function-ids';
37
37
  import { GET_TASK_CONTEXT_FUNCTION_ID } from './task-context-function-ids';
38
38
  import { ArchitectAgentId, ExploreAgentId } from './agent-ids';
39
+ import { OPEN_EDITORS_HINT_FRAGMENT_ID } from './open-editors-hint-fragment-id';
39
40
 
40
41
  export const CODER_SYSTEM_PROMPT_ID = 'coder-system';
41
42
 
42
43
  export const CODER_EDIT_TEMPLATE_ID = 'coder-system-edit';
43
- export const CODER_EDIT_NEXT_TEMPLATE_ID = 'coder-system-edit-next';
44
44
  export const CODER_AGENT_MODE_TEMPLATE_ID = 'coder-system-agent-mode';
45
45
  export const CODER_AGENT_MODE_NEXT_TEMPLATE_ID = 'coder-system-agent-mode-next';
46
46
 
@@ -259,6 +259,8 @@ Always retrieve relevant files using ~{${FILE_CONTENT_FUNCTION_ID}} to understan
259
259
  ## Project Info
260
260
  {{prompt:project-info}}
261
261
 
262
+ {{prompt:${OPEN_EDITORS_HINT_FRAGMENT_ID}}}
263
+
262
264
  {{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
263
265
 
264
266
  # Final Instruction
@@ -459,6 +461,8 @@ When review feedback is recorded in the task context (REVISE verdict): evaluate
459
461
 
460
462
  {{capability:apptester default off}}
461
463
 
464
+ {{capability:memory default off}}
465
+
462
466
  ## Final Review
463
467
 
464
468
  Confirm: works as intended, tests pass, code quality OK, no security issues. Then yield.
@@ -545,6 +549,8 @@ Always retrieve relevant files using ~{${FILE_CONTENT_FUNCTION_ID}} to understan
545
549
  ## Project Info
546
550
  {{prompt:project-info}}
547
551
 
552
+ {{prompt:${OPEN_EDITORS_HINT_FRAGMENT_ID}}}
553
+
548
554
  {{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
549
555
 
550
556
  # Final Instruction
@@ -635,6 +641,8 @@ You have previously proposed changes for the following files. Some suggestions m
635
641
 
636
642
  {{prompt:project-info}}
637
643
 
644
+ {{prompt:${OPEN_EDITORS_HINT_FRAGMENT_ID}}}
645
+
638
646
  {{${TASK_CONTEXT_SUMMARY_VARIABLE_ID}}}
639
647
 
640
648
  ## Final Instruction
@@ -651,11 +659,3 @@ export function getCoderPromptTemplateEdit(): BasePromptFragment {
651
659
  template: getCoderEditPromptTemplate()
652
660
  };
653
661
  }
654
- // Currently, the next template is identical to the regular edit prompt
655
- export function getCoderPromptTemplateEditNext(): BasePromptFragment {
656
- return {
657
- id: CODER_EDIT_NEXT_TEMPLATE_ID,
658
- template: getCoderEditPromptTemplate(),
659
- ...({ variantOf: CODER_EDIT_TEMPLATE_ID })
660
- };
661
- }
@@ -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
 
17
- import { inject, injectable } from '@theia/core/shared/inversify';
17
+ import { inject, injectable, named } from '@theia/core/shared/inversify';
18
18
  import { AbstractTextToModelParsingChatAgent, SystemMessageDescription } from '@theia/ai-chat/lib/common/chat-agents';
19
19
  import { AIVariableContext, LanguageModelRequirement } from '@theia/ai-core';
20
20
  import {
@@ -30,6 +30,7 @@ import {
30
30
  MessageService,
31
31
  generateUuid,
32
32
  nls,
33
+ ILogger
33
34
  } from '@theia/core';
34
35
 
35
36
  import { commandTemplate } from './command-prompt-template';
@@ -48,6 +49,9 @@ export class CommandChatAgent extends AbstractTextToModelParsingChatAgent<Parsed
48
49
  @inject(MessageService)
49
50
  protected messageService: MessageService;
50
51
 
52
+ @inject(ILogger) @named('ai-ide:CommandChatAgent')
53
+ protected override readonly logger: ILogger;
54
+
51
55
  id: string = 'Command';
52
56
  name = 'Command';
53
57
  languageModelRequirements: LanguageModelRequirement[] = [{
@@ -103,7 +107,7 @@ export class CommandChatAgent extends AbstractTextToModelParsingChatAgent<Parsed
103
107
  if (parsedCommand.type === 'theia-command') {
104
108
  const theiaCommand = this.commandRegistry.getCommand(parsedCommand.commandId);
105
109
  if (theiaCommand === undefined) {
106
- console.error(`No Theia Command with id ${parsedCommand.commandId}`);
110
+ this.logger.error(`No Theia Command with id ${parsedCommand.commandId}`);
107
111
  request.cancel();
108
112
  }
109
113
  const args = parsedCommand.arguments !== undefined &&
@@ -1,5 +1,5 @@
1
1
  // *****************************************************************************
2
- // Copyright (C) 2025 EclipseSource GmbH.
2
+ // Copyright (C) 2026 EclipseSource GmbH.
3
3
  //
4
4
  // This program and the accompanying materials are made available under the
5
5
  // terms of the Eclipse Public License v. 2.0 which is available at
@@ -13,25 +13,5 @@
13
13
  //
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
- import * as React from '@theia/core/shared/react';
17
- import { injectable } from '@theia/core/shared/inversify';
18
- import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
19
16
 
20
- /**
21
- * Base class for all AI configuration widgets providing common structure and lifecycle management.
22
- */
23
- @injectable()
24
- export abstract class AIConfigurationBaseWidget extends ReactWidget {
25
- /**
26
- * Subclasses must implement this method to provide their specific content rendering.
27
- */
28
- protected abstract renderContent(): React.ReactNode;
29
-
30
- protected render(): React.ReactNode {
31
- return (
32
- <div className='ai-configuration-widget-content'>
33
- {this.renderContent()}
34
- </div>
35
- );
36
- }
37
- }
17
+ export const OPEN_EDITORS_HINT_FRAGMENT_ID = 'open-editors-hint';