@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
@@ -1,5 +1,7 @@
1
1
  import { AiConfigurationService, ToolProvider, ToolRequest } from '@theia/ai-core';
2
- import { CancellationToken, PreferenceService, URI } from '@theia/core';
2
+ import { FileReadTracker } from '@theia/ai-chat';
3
+ import { CancellationToken, PreferenceService, URI, ILogger } from '@theia/core';
4
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
3
5
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
4
6
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
5
7
  import { FileStat } from '@theia/filesystem/lib/common/files';
@@ -10,6 +12,20 @@ import { MonacoWorkspace } from '@theia/monaco/lib/browser/monaco-workspace';
10
12
  import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
11
13
  import { ProblemManager } from '@theia/markers/lib/browser';
12
14
  import { Range } from '@theia/core/shared/vscode-languageserver-protocol';
15
+ export declare const AccessibleRootContribution: unique symbol;
16
+ /**
17
+ * Contributes directories outside the workspace roots that the AI workspace tools may access, in
18
+ * addition to the user-configured `ai-features.workspaceFunctions.allowedExternalPaths`. This is meant
19
+ * for locations Theia owns and resolves itself, such as the memory store of the current workspace,
20
+ * whose path is generated and can therefore not be named in a preference by the user.
21
+ */
22
+ export interface AccessibleRootContribution {
23
+ /**
24
+ * The currently accessible roots. Queried on every check rather than once, so that a root which
25
+ * moves with the workspace is picked up without invalidation.
26
+ */
27
+ getRoots(): Promise<URI[]>;
28
+ }
13
29
  export declare class WorkspaceFunctionScope {
14
30
  protected readonly GITIGNORE_FILE_NAME = ".gitignore";
15
31
  protected readonly workspaceService: WorkspaceService;
@@ -17,6 +33,8 @@ export declare class WorkspaceFunctionScope {
17
33
  protected readonly preferences: PreferenceService;
18
34
  protected readonly aiConfiguration: AiConfigurationService;
19
35
  protected readonly envVariablesServer: EnvVariablesServer;
36
+ protected readonly logger: ILogger;
37
+ protected readonly accessibleRootContributions: ContributionProvider<AccessibleRootContribution> | undefined;
20
38
  private gitignoreMatchers;
21
39
  private gitignoreWatchersInitialized;
22
40
  private _rootMapping;
@@ -70,13 +88,19 @@ export declare class WorkspaceFunctionScope {
70
88
  */
71
89
  resolveRelativePath(relativePath: string): URI;
72
90
  resolveToUri(pathOrUri: string | URI): Promise<URI | undefined>;
73
- ensureWithinWorkspace(targetUri: URI, workspaceRootUri: URI): void;
74
91
  /**
75
- * Asserts the target URI is reachable by AI tools that honor the external
76
- * allow-list. Allowed when the URI is inside any workspace root, or when it
77
- * is covered by an entry of the `ai-features.workspaceFunctions.allowedExternalPaths`
78
- * preference. Workspace-scoped overrides of that preference are dropped when
79
- * the workspace is not trusted.
92
+ * Resolves a tool argument and asserts that it may be accessed. This is the single entry point every
93
+ * tool uses, so that a path is subjected to the same parsing and the same boundary check no matter
94
+ * which tool received it.
95
+ *
96
+ * @throws if the path cannot be resolved or points outside the accessible roots.
97
+ */
98
+ resolveAccessiblePath(pathOrUri: string): Promise<URI>;
99
+ /**
100
+ * Asserts the target URI is reachable by the AI tools. Allowed when the URI is inside any workspace
101
+ * root, below a root contributed by an {@link AccessibleRootContribution}, or covered by an entry of
102
+ * the `ai-features.workspaceFunctions.allowedExternalPaths` preference. Workspace-scoped overrides of
103
+ * that preference are dropped when the workspace is not trusted.
80
104
  *
81
105
  * The target URI is normalized before the check so that literal `..`
82
106
  * segments and percent-encoded equivalents (e.g. `%2e%2e`) are resolved
@@ -86,6 +110,12 @@ export declare class WorkspaceFunctionScope {
86
110
  * before the check. Only allow-list directories whose contents you trust.
87
111
  */
88
112
  ensureAccessible(targetUri: URI): Promise<void>;
113
+ protected isUnderAny(roots: URI[], normalizedTarget: URI): boolean;
114
+ /**
115
+ * The roots contributed by {@link AccessibleRootContribution}s, normalized like the allow-list. A
116
+ * contribution that fails to resolve is skipped rather than allowed to fail every path check.
117
+ */
118
+ protected getContributedRootUris(): Promise<URI[]>;
89
119
  isInWorkspace(uri: URI): boolean;
90
120
  isInPrimaryWorkspace(uri: URI): boolean;
91
121
  /**
@@ -166,9 +196,16 @@ export declare class FileContentFunction implements ToolProvider {
166
196
  protected readonly workspaceScope: WorkspaceFunctionScope;
167
197
  protected readonly monacoWorkspace: MonacoWorkspace;
168
198
  protected readonly preferences: PreferenceService;
199
+ /** Optional: tracking is advisory, so containers without a tracker still get a working tool. */
200
+ protected readonly fileReadTracker: FileReadTracker | undefined;
169
201
  private parseArg;
170
202
  private getFileContent;
171
203
  private handleEditorContent;
204
+ /**
205
+ * Remembers the content handed to the agent, if it came from a chat session at all. Only full reads are
206
+ * tracked: a slice says nothing about the rest of the file, so the streaming path is skipped.
207
+ */
208
+ private trackRead;
172
209
  private handleFullDiskRead;
173
210
  private readStreamedSlice;
174
211
  private sizeInKB;
@@ -188,6 +225,7 @@ export declare class FileDiagnosticProvider implements ToolProvider {
188
225
  protected readonly workspaceScope: WorkspaceFunctionScope;
189
226
  protected readonly problemManager: ProblemManager;
190
227
  protected readonly modelService: MonacoTextModelService;
228
+ protected readonly logger: ILogger;
191
229
  getTool(): ToolRequest;
192
230
  protected getDiagnosticsForFile(uri: URI, cancellationToken?: CancellationToken): Promise<string>;
193
231
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-functions.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-functions.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,sBAAsB,EAAyB,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAAE,iBAAiB,EAAkB,iBAAiB,EAAE,GAAG,EAAQ,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAA2C,MAAM,oCAAoC,CAAC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,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEnC,OAAO,IAAI,WAAW;cAoCN,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAuEvG;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,GAAG,KAAK;CAmBhG;AAED,qBACa,kBAAmB,YAAW,YAAY;IACnD,MAAM,CAAC,EAAE,SAAqC;IAG9C,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IAGlD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,OAAO,IAAI,WAAW;YA8DR,SAAS;IAiFvB;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE;QAAE,OAAO,EAAE,GAAG,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,GAAG,SAAS;CAU1H"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var WorkspaceFunctionScope_1, GetWorkspaceDirectoryStructure_1, FileContentFunction_1, GetWorkspaceFileList_1, FileDiagnosticProvider_1, FindFilesByPattern_1;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.FindFilesByPattern = exports.FileDiagnosticProvider = exports.GetWorkspaceFileList = exports.FileContentFunction = exports.GetWorkspaceDirectoryStructure = exports.WorkspaceFunctionScope = void 0;
4
+ exports.FindFilesByPattern = exports.FileDiagnosticProvider = exports.GetWorkspaceFileList = exports.FileContentFunction = exports.GetWorkspaceDirectoryStructure = exports.WorkspaceFunctionScope = exports.AccessibleRootContribution = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  // *****************************************************************************
7
7
  // Copyright (C) 2024 EclipseSource GmbH.
@@ -19,7 +19,9 @@ const tslib_1 = require("tslib");
19
19
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
20
20
  // *****************************************************************************
21
21
  const ai_core_1 = require("@theia/ai-core");
22
+ const ai_chat_1 = require("@theia/ai-chat");
22
23
  const core_1 = require("@theia/core");
24
+ const contribution_provider_1 = require("@theia/core/lib/common/contribution-provider");
23
25
  const env_variables_1 = require("@theia/core/lib/common/env-variables");
24
26
  const inversify_1 = require("@theia/core/shared/inversify");
25
27
  const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
@@ -35,6 +37,7 @@ const monaco_workspace_1 = require("@theia/monaco/lib/browser/monaco-workspace")
35
37
  const monaco_text_model_service_1 = require("@theia/monaco/lib/browser/monaco-text-model-service");
36
38
  const browser_2 = require("@theia/markers/lib/browser");
37
39
  const vscode_languageserver_protocol_1 = require("@theia/core/shared/vscode-languageserver-protocol");
40
+ exports.AccessibleRootContribution = Symbol('AccessibleRootContribution');
38
41
  let WorkspaceFunctionScope = WorkspaceFunctionScope_1 = class WorkspaceFunctionScope {
39
42
  constructor() {
40
43
  this.GITIGNORE_FILE_NAME = '.gitignore';
@@ -82,7 +85,7 @@ let WorkspaceFunctionScope = WorkspaceFunctionScope_1 = class WorkspaceFunctionS
82
85
  for (const root of sortedRoots) {
83
86
  const basename = root.resource.path.base;
84
87
  if (mapping.has(basename)) {
85
- console.debug(`Multiple workspace roots share the basename '${basename}'. ` +
88
+ this.logger.debug(`Multiple workspace roots share the basename '${basename}'. ` +
86
89
  `Only '${mapping.get(basename).toString()}' is addressable as '${basename}'. ` +
87
90
  `'${root.resource.toString()}' can still be accessed but may require full paths.`);
88
91
  continue;
@@ -236,19 +239,26 @@ let WorkspaceFunctionScope = WorkspaceFunctionScope_1 = class WorkspaceFunctionS
236
239
  return this.resolveRelativePath(normalizedPath);
237
240
  }
238
241
  // ── Access control ──────────────────────────────────────────────────
239
- ensureWithinWorkspace(targetUri, workspaceRootUri) {
240
- const normalized = targetUri.normalizePath();
241
- if (workspaceRootUri.scheme !== normalized.scheme
242
- || !workspaceRootUri.isEqualOrParent(normalized, WorkspaceFunctionScope_1.pathCaseSensitive)) {
243
- throw new Error('Access outside of the workspace is not allowed');
242
+ /**
243
+ * Resolves a tool argument and asserts that it may be accessed. This is the single entry point every
244
+ * tool uses, so that a path is subjected to the same parsing and the same boundary check no matter
245
+ * which tool received it.
246
+ *
247
+ * @throws if the path cannot be resolved or points outside the accessible roots.
248
+ */
249
+ async resolveAccessiblePath(pathOrUri) {
250
+ const resolved = await this.resolveToUri(pathOrUri);
251
+ if (!resolved) {
252
+ throw new Error(`Invalid path: '${pathOrUri}'`);
244
253
  }
254
+ await this.ensureAccessible(resolved);
255
+ return resolved;
245
256
  }
246
257
  /**
247
- * Asserts the target URI is reachable by AI tools that honor the external
248
- * allow-list. Allowed when the URI is inside any workspace root, or when it
249
- * is covered by an entry of the `ai-features.workspaceFunctions.allowedExternalPaths`
250
- * preference. Workspace-scoped overrides of that preference are dropped when
251
- * the workspace is not trusted.
258
+ * Asserts the target URI is reachable by the AI tools. Allowed when the URI is inside any workspace
259
+ * root, below a root contributed by an {@link AccessibleRootContribution}, or covered by an entry of
260
+ * the `ai-features.workspaceFunctions.allowedExternalPaths` preference. Workspace-scoped overrides of
261
+ * that preference are dropped when the workspace is not trusted.
252
262
  *
253
263
  * The target URI is normalized before the check so that literal `..`
254
264
  * segments and percent-encoded equivalents (e.g. `%2e%2e`) are resolved
@@ -259,20 +269,36 @@ let WorkspaceFunctionScope = WorkspaceFunctionScope_1 = class WorkspaceFunctionS
259
269
  */
260
270
  async ensureAccessible(targetUri) {
261
271
  const normalized = targetUri.normalizePath();
262
- const caseSensitive = WorkspaceFunctionScope_1.pathCaseSensitive;
263
- const roots = this.getAllRootUris();
264
- for (const rootUri of roots) {
265
- if (rootUri.scheme === normalized.scheme && rootUri.isEqualOrParent(normalized, caseSensitive)) {
266
- return;
267
- }
268
- }
269
- const allowed = await this.getAllowedExternalUris();
270
- if (allowed.some(allowedUri => allowedUri.scheme === normalized.scheme && allowedUri.isEqualOrParent(normalized, caseSensitive))) {
272
+ if (this.isUnderAny(this.getAllRootUris(), normalized)
273
+ || this.isUnderAny(await this.getContributedRootUris(), normalized)
274
+ || this.isUnderAny(await this.getAllowedExternalUris(), normalized)) {
271
275
  return;
272
276
  }
273
277
  throw new Error(`Access to '${normalized.path.toString()}' is not allowed. ` +
274
278
  `Path is outside the workspace and not covered by the '${workspace_preferences_1.ALLOWED_EXTERNAL_PATHS_PREF}' preference.`);
275
279
  }
280
+ isUnderAny(roots, normalizedTarget) {
281
+ const caseSensitive = WorkspaceFunctionScope_1.pathCaseSensitive;
282
+ return roots.some(root => root.scheme === normalizedTarget.scheme && root.isEqualOrParent(normalizedTarget, caseSensitive));
283
+ }
284
+ /**
285
+ * The roots contributed by {@link AccessibleRootContribution}s, normalized like the allow-list. A
286
+ * contribution that fails to resolve is skipped rather than allowed to fail every path check.
287
+ */
288
+ async getContributedRootUris() {
289
+ const roots = [];
290
+ for (const contribution of this.accessibleRootContributions?.getContributions() ?? []) {
291
+ try {
292
+ for (const root of await contribution.getRoots()) {
293
+ roots.push(WorkspaceFunctionScope_1.withoutTrailingSeparator(root.normalizePath()));
294
+ }
295
+ }
296
+ catch (error) {
297
+ this.logger.warn('Failed to resolve accessible roots from a contribution.', error);
298
+ }
299
+ }
300
+ return roots;
301
+ }
276
302
  isInWorkspace(uri) {
277
303
  try {
278
304
  const roots = this.getAllRootUris();
@@ -518,6 +544,17 @@ tslib_1.__decorate([
518
544
  (0, inversify_1.inject)(env_variables_1.EnvVariablesServer),
519
545
  tslib_1.__metadata("design:type", Object)
520
546
  ], WorkspaceFunctionScope.prototype, "envVariablesServer", void 0);
547
+ tslib_1.__decorate([
548
+ (0, inversify_1.inject)(core_1.ILogger),
549
+ (0, inversify_1.named)('ai-ide:WorkspaceFunctionScope'),
550
+ tslib_1.__metadata("design:type", Object)
551
+ ], WorkspaceFunctionScope.prototype, "logger", void 0);
552
+ tslib_1.__decorate([
553
+ (0, inversify_1.inject)(contribution_provider_1.ContributionProvider),
554
+ (0, inversify_1.named)(exports.AccessibleRootContribution),
555
+ (0, inversify_1.optional)(),
556
+ tslib_1.__metadata("design:type", Object)
557
+ ], WorkspaceFunctionScope.prototype, "accessibleRootContributions", void 0);
521
558
  tslib_1.__decorate([
522
559
  (0, inversify_1.postConstruct)(),
523
560
  tslib_1.__metadata("design:type", Function),
@@ -536,8 +573,8 @@ let GetWorkspaceDirectoryStructure = class GetWorkspaceDirectoryStructure {
536
573
  name: GetWorkspaceDirectoryStructure_1.ID,
537
574
  description: 'Retrieves the directory tree structure as a nested JSON object. ' +
538
575
  'By default returns all workspace roots with root names as keys. ' +
539
- 'Pass `root` to inspect a specific directory listed in the ' +
540
- '`ai-features.workspaceFunctions.allowedExternalPaths` preference instead. ' +
576
+ 'Pass `root` to inspect a specific directory the tools may access, such as one listed in the ' +
577
+ '`ai-features.workspaceFunctions.allowedExternalPaths` preference, instead. ' +
541
578
  'Lists only directories (no files), excluding common non-essential directories (node_modules, hidden files, etc.). ' +
542
579
  'Useful for getting a high-level overview of project organization. ' +
543
580
  'For listing files within a specific directory, use getWorkspaceFileList instead. ' +
@@ -548,7 +585,7 @@ let GetWorkspaceDirectoryStructure = class GetWorkspaceDirectoryStructure {
548
585
  root: {
549
586
  type: 'string',
550
587
  description: 'Optional absolute path or `file://` URI to inspect instead of the workspace. ' +
551
- 'Must be inside, or equal to, an entry of the `allowedExternalPaths` preference. ' +
588
+ 'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
552
589
  'When omitted, all workspace roots are returned.'
553
590
  }
554
591
  },
@@ -573,11 +610,7 @@ let GetWorkspaceDirectoryStructure = class GetWorkspaceDirectoryStructure {
573
610
  }
574
611
  try {
575
612
  if (root) {
576
- const resolved = await this.workspaceScope.resolveToUri(root);
577
- if (!resolved) {
578
- return { error: `Invalid root: '${root}'` };
579
- }
580
- await this.workspaceScope.ensureAccessible(resolved);
613
+ const resolved = await this.workspaceScope.resolveAccessiblePath(root);
581
614
  return this.buildDirectoryStructure(resolved, cancellationToken);
582
615
  }
583
616
  else {
@@ -649,8 +682,8 @@ let FileContentFunction = class FileContentFunction {
649
682
  description: 'Returns the content of a specified file as a raw string. ' +
650
683
  'File paths use the same format returned by other workspace tools ' +
651
684
  '(e.g., "my-project/src/index.ts"). ' +
652
- 'Absolute paths and `file://` URIs are accepted when the target is inside the workspace ' +
653
- 'or covered by the `ai-features.workspaceFunctions.allowedExternalPaths` preference. ' +
685
+ 'Absolute paths and `file://` URIs are accepted when the target is a location the tools may access, ' +
686
+ 'such as a directory listed in the `ai-features.workspaceFunctions.allowedExternalPaths` preference. ' +
654
687
  'If the file is currently open in an editor with unsaved changes, returns the editor\'s current content (not the saved file on disk). ' +
655
688
  'Binary files may not be readable and will return an error. ' +
656
689
  'Use this tool to read file contents before making any edits with replacement functions. ' +
@@ -667,8 +700,8 @@ let FileContentFunction = class FileContentFunction {
667
700
  type: 'string',
668
701
  description: 'Path to the target file. May be workspace-relative ' +
669
702
  '(e.g., "my-project/src/index.ts"), an absolute path, or a `file://` URI. ' +
670
- 'Absolute / URI forms must point inside the workspace ' +
671
- 'or inside a directory listed in the `allowedExternalPaths` preference.',
703
+ 'Absolute / URI forms must point to a location the tools may access, such as a directory listed in the ' +
704
+ '`allowedExternalPaths` preference.',
672
705
  },
673
706
  offset: {
674
707
  type: 'number',
@@ -684,7 +717,7 @@ let FileContentFunction = class FileContentFunction {
684
717
  },
685
718
  handler: (arg_string, ctx) => {
686
719
  const { file, offset, limit } = this.parseArg(arg_string);
687
- return this.getFileContent(file, ctx?.cancellationToken, offset, limit);
720
+ return this.getFileContent(file, ctx, offset, limit);
688
721
  },
689
722
  providerName: undefined,
690
723
  getArgumentsShortLabel: (args) => {
@@ -709,7 +742,8 @@ let FileContentFunction = class FileContentFunction {
709
742
  const result = JSON.parse(arg_string);
710
743
  return { file: result.file, offset: result.offset, limit: result.limit };
711
744
  }
712
- async getFileContent(file, cancellationToken, offset, limit) {
745
+ async getFileContent(file, ctx, offset, limit) {
746
+ const cancellationToken = ctx?.cancellationToken;
713
747
  if (cancellationToken?.isCancellationRequested) {
714
748
  return JSON.stringify({ error: 'Operation cancelled by user' });
715
749
  }
@@ -721,12 +755,7 @@ let FileContentFunction = class FileContentFunction {
721
755
  }
722
756
  let targetUri;
723
757
  try {
724
- const resolved = await this.workspaceScope.resolveToUri(file);
725
- if (!resolved) {
726
- return JSON.stringify({ error: `Invalid file path: '${file}'` });
727
- }
728
- targetUri = resolved;
729
- await this.workspaceScope.ensureAccessible(targetUri);
758
+ targetUri = await this.workspaceScope.resolveAccessiblePath(file);
730
759
  }
731
760
  catch (error) {
732
761
  return JSON.stringify({ error: error.message });
@@ -739,21 +768,22 @@ let FileContentFunction = class FileContentFunction {
739
768
  const isEditorOpen = openEditorValue !== undefined;
740
769
  const isPaginated = offset !== undefined || limit !== undefined;
741
770
  if (isEditorOpen) {
742
- return this.handleEditorContent(openEditorValue, maxSizeKB, offset, limit);
771
+ return this.handleEditorContent(targetUri, openEditorValue, maxSizeKB, ctx, offset, limit);
743
772
  }
744
773
  else if (isPaginated) {
745
774
  return this.readStreamedSlice(targetUri, maxSizeKB, offset, limit);
746
775
  }
747
776
  else {
748
- return this.handleFullDiskRead(targetUri, maxSizeKB);
777
+ return this.handleFullDiskRead(targetUri, maxSizeKB, ctx);
749
778
  }
750
779
  }
751
- handleEditorContent(content, maxSizeKB, offset, limit) {
780
+ async handleEditorContent(targetUri, content, maxSizeKB, ctx, offset, limit) {
752
781
  if (offset === undefined && limit === undefined) {
753
782
  const sizeKB = this.sizeInKB(content);
754
783
  if (sizeKB > maxSizeKB) {
755
784
  return this.buildFileSizeLimitError(sizeKB, maxSizeKB);
756
785
  }
786
+ await this.trackRead(targetUri, content, ctx);
757
787
  return content;
758
788
  }
759
789
  const lines = content.split('\n');
@@ -769,7 +799,16 @@ let FileContentFunction = class FileContentFunction {
769
799
  const header = `[Lines ${startLine}\u2013${endLine} of ${lines.length} total. Use offset and limit to read other ranges.]`;
770
800
  return `${header}\n${result}`;
771
801
  }
772
- async handleFullDiskRead(targetUri, maxSizeKB) {
802
+ /**
803
+ * Remembers the content handed to the agent, if it came from a chat session at all. Only full reads are
804
+ * tracked: a slice says nothing about the rest of the file, so the streaming path is skipped.
805
+ */
806
+ async trackRead(targetUri, content, ctx) {
807
+ if (ai_chat_1.ChatToolContext.is(ctx)) {
808
+ await this.fileReadTracker?.recordRead(ctx.request.session.id, targetUri, content);
809
+ }
810
+ }
811
+ async handleFullDiskRead(targetUri, maxSizeKB, ctx) {
773
812
  try {
774
813
  const stat = await this.fileService.resolve(targetUri);
775
814
  if (stat.size !== undefined) {
@@ -788,6 +827,7 @@ let FileContentFunction = class FileContentFunction {
788
827
  if (sizeKB > maxSizeKB) {
789
828
  return this.buildFileSizeLimitError(sizeKB, maxSizeKB);
790
829
  }
830
+ await this.trackRead(targetUri, rawContent, ctx);
791
831
  return rawContent;
792
832
  }
793
833
  catch (error) {
@@ -906,6 +946,11 @@ tslib_1.__decorate([
906
946
  (0, inversify_1.inject)(core_1.PreferenceService),
907
947
  tslib_1.__metadata("design:type", Object)
908
948
  ], FileContentFunction.prototype, "preferences", void 0);
949
+ tslib_1.__decorate([
950
+ (0, inversify_1.inject)(ai_chat_1.FileReadTracker),
951
+ (0, inversify_1.optional)(),
952
+ tslib_1.__metadata("design:type", Object)
953
+ ], FileContentFunction.prototype, "fileReadTracker", void 0);
909
954
  exports.FileContentFunction = FileContentFunction = FileContentFunction_1 = tslib_1.__decorate([
910
955
  (0, inversify_1.injectable)()
911
956
  ], FileContentFunction);
@@ -924,7 +969,8 @@ let GetWorkspaceFileList = class GetWorkspaceFileList {
924
969
  description: 'Path to a directory. Workspace-relative paths use the format \'rootName/path\' ' +
925
970
  '(e.g., \'my-project/src\', \'backend/src/components\'). ' +
926
971
  'Use \'\' or \'.\' to list the workspace top-level directories. ' +
927
- 'Absolute paths and `file://` URIs are accepted when covered by the `allowedExternalPaths` preference.'
972
+ 'Absolute paths and `file://` URIs are accepted when they point to a location the tools may access, ' +
973
+ 'such as a directory listed in the `allowedExternalPaths` preference.'
928
974
  }
929
975
  },
930
976
  required: ['path']
@@ -959,12 +1005,7 @@ let GetWorkspaceFileList = class GetWorkspaceFileList {
959
1005
  }
960
1006
  let targetUri;
961
1007
  try {
962
- const resolved = await this.workspaceScope.resolveToUri(path);
963
- if (!resolved) {
964
- return JSON.stringify({ error: `Invalid path: '${path}'` });
965
- }
966
- targetUri = resolved;
967
- await this.workspaceScope.ensureAccessible(targetUri);
1008
+ targetUri = await this.workspaceScope.resolveAccessiblePath(path);
968
1009
  }
969
1010
  catch (error) {
970
1011
  return JSON.stringify({ error: error.message });
@@ -1033,8 +1074,9 @@ let FileDiagnosticProvider = class FileDiagnosticProvider {
1033
1074
  properties: {
1034
1075
  file: {
1035
1076
  type: 'string',
1036
- description: 'The path to the target file within the workspace ' +
1037
- '(e.g., "my-project/src/index.ts", "backend/src/main.ts").'
1077
+ description: 'The path to the target file. May be workspace-relative ' +
1078
+ '(e.g., "my-project/src/index.ts", "backend/src/main.ts"), an absolute path, or a `file://` URI ' +
1079
+ 'pointing to a location the tools may access.'
1038
1080
  }
1039
1081
  },
1040
1082
  required: ['file']
@@ -1042,12 +1084,7 @@ let FileDiagnosticProvider = class FileDiagnosticProvider {
1042
1084
  handler: async (arg, ctx) => {
1043
1085
  try {
1044
1086
  const { file } = JSON.parse(arg);
1045
- const targetUri = await this.workspaceScope.resolveRelativePath(file);
1046
- const containingRoot = this.workspaceScope.getContainingRoot(targetUri);
1047
- if (!containingRoot) {
1048
- return JSON.stringify({ error: 'Access outside of the workspace is not allowed' });
1049
- }
1050
- this.workspaceScope.ensureWithinWorkspace(targetUri, containingRoot);
1087
+ const targetUri = await this.workspaceScope.resolveAccessiblePath(file);
1051
1088
  return this.getDiagnosticsForFile(targetUri, ctx?.cancellationToken);
1052
1089
  }
1053
1090
  catch (error) {
@@ -1112,7 +1149,7 @@ let FileDiagnosticProvider = class FileDiagnosticProvider {
1112
1149
  if (err.message === 'Operation cancelled by user') {
1113
1150
  return JSON.stringify({ error: 'Operation cancelled by user' });
1114
1151
  }
1115
- console.warn('Error when fetching markers for', uri.toString(), err);
1152
+ this.logger.warn('Error when fetching markers for', uri.toString(), err);
1116
1153
  return JSON.stringify({ error: err instanceof Error ? err.message : 'Unknown error when fetching for problems for ' + uri.toString() });
1117
1154
  }
1118
1155
  finally {
@@ -1157,6 +1194,11 @@ tslib_1.__decorate([
1157
1194
  (0, inversify_1.inject)(monaco_text_model_service_1.MonacoTextModelService),
1158
1195
  tslib_1.__metadata("design:type", monaco_text_model_service_1.MonacoTextModelService)
1159
1196
  ], FileDiagnosticProvider.prototype, "modelService", void 0);
1197
+ tslib_1.__decorate([
1198
+ (0, inversify_1.inject)(core_1.ILogger),
1199
+ (0, inversify_1.named)('ai-ide:FileDiagnosticProvider'),
1200
+ tslib_1.__metadata("design:type", Object)
1201
+ ], FileDiagnosticProvider.prototype, "logger", void 0);
1160
1202
  exports.FileDiagnosticProvider = FileDiagnosticProvider = FileDiagnosticProvider_1 = tslib_1.__decorate([
1161
1203
  (0, inversify_1.injectable)()
1162
1204
  ], FileDiagnosticProvider);
@@ -1169,8 +1211,8 @@ let FindFilesByPattern = class FindFilesByPattern {
1169
1211
  name: FindFilesByPattern_1.ID,
1170
1212
  description: 'Find files matching a given glob pattern. ' +
1171
1213
  'By default searches across all workspace roots. ' +
1172
- 'Pass `searchRoot` to search a directory listed in the ' +
1173
- '`ai-features.workspaceFunctions.allowedExternalPaths` preference instead. ' +
1214
+ 'Pass `searchRoot` to search a directory the tools may access, such as one listed in the ' +
1215
+ '`ai-features.workspaceFunctions.allowedExternalPaths` preference, instead. ' +
1174
1216
  'This function allows efficient discovery of files using patterns like \'**/*.ts\' for all TypeScript files or ' +
1175
1217
  '\'src/**/*.js\' for JavaScript files in the src directory. The function respects gitignore patterns and user exclusions, ' +
1176
1218
  'returns workspace-relative paths (e.g., "my-project/src/index.ts") or absolute paths for external roots, ' +
@@ -1195,7 +1237,7 @@ let FindFilesByPattern = class FindFilesByPattern {
1195
1237
  searchRoot: {
1196
1238
  type: 'string',
1197
1239
  description: 'Optional absolute path or `file://` URI to search instead of the workspace. ' +
1198
- 'Must be inside, or equal to, an entry of the `allowedExternalPaths` preference. ' +
1240
+ 'Must point to a directory the tools may access, such as one listed in the `allowedExternalPaths` preference. ' +
1199
1241
  'When set, results are returned as absolute paths so they can be passed back to getFileContent. ' +
1200
1242
  'When omitted (default), all workspace roots are searched and results are workspace-relative.'
1201
1243
  }
@@ -1237,11 +1279,7 @@ let FindFilesByPattern = class FindFilesByPattern {
1237
1279
  // Resolve the set of roots to search and how each root's results should be rendered.
1238
1280
  const targets = [];
1239
1281
  if (searchRoot) {
1240
- const resolved = await this.workspaceScope.resolveToUri(searchRoot);
1241
- if (!resolved) {
1242
- return JSON.stringify({ error: `Invalid searchRoot: '${searchRoot}'` });
1243
- }
1244
- await this.workspaceScope.ensureAccessible(resolved);
1282
+ const resolved = await this.workspaceScope.resolveAccessiblePath(searchRoot);
1245
1283
  targets.push({ rootUri: resolved, external: !this.workspaceScope.isInWorkspace(resolved) });
1246
1284
  }
1247
1285
  else {
@@ -1306,7 +1344,7 @@ let FindFilesByPattern = class FindFilesByPattern {
1306
1344
  */
1307
1345
  toDisplayPath(match, target) {
1308
1346
  if (target.external) {
1309
- return match.path.toString();
1347
+ return match.path.fsPath();
1310
1348
  }
1311
1349
  const relativePath = target.rootUri.relative(match)?.toString();
1312
1350
  if (relativePath === undefined) {