@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
@@ -0,0 +1,237 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as React from '@theia/core/shared/react';
18
+ import { nls, PreferenceService } from '@theia/core';
19
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
20
+ import { codicon, Message, ReactWidget } from '@theia/core/lib/browser';
21
+ import { AiConfigurationService } from '@theia/ai-core';
22
+ import { AiConfigurationCategoryRegistry } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category-registry';
23
+ import { AiConfigurationSelectionModel } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-selection-model';
24
+ import { AiConfigurationItemDetailHeader } from '@theia/ai-core-ui/lib/browser/ai-configuration/components/ai-configuration-primitives';
25
+ import {
26
+ AiConfigurationCategory, AiConfigurationRenderContext, AiConfigurationScope, AiConfigurationSelection
27
+ } from '@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category';
28
+
29
+ @injectable()
30
+ export class AiConfigurationDetailWidget extends ReactWidget {
31
+
32
+ static readonly ID = 'ai-configuration-detail';
33
+
34
+ /** Frames a pending search highlight waits for its target row to be mounted before it is dropped. */
35
+ static readonly HIGHLIGHT_RETRY_FRAMES = 10;
36
+
37
+ @inject(AiConfigurationCategoryRegistry)
38
+ protected readonly registry: AiConfigurationCategoryRegistry;
39
+
40
+ @inject(AiConfigurationSelectionModel)
41
+ protected readonly selectionModel: AiConfigurationSelectionModel;
42
+
43
+ @inject(AiConfigurationService)
44
+ protected readonly aiConfigurationService: AiConfigurationService;
45
+
46
+ @inject(PreferenceService)
47
+ protected readonly preferenceService: PreferenceService;
48
+
49
+ /** Scope every row on the page reads from and writes to; per-scope editing is not wired up yet. */
50
+ protected scope: AiConfigurationScope = 'user';
51
+
52
+ protected resetScroll = false;
53
+ protected pendingHighlight?: AiConfigurationSelection['highlight'];
54
+ /** Frames a pending highlight has already waited for its target row; see {@link applyScrollAndHighlight}. */
55
+ protected pendingHighlightFrames = 0;
56
+
57
+ @postConstruct()
58
+ protected init(): void {
59
+ this.id = AiConfigurationDetailWidget.ID;
60
+ this.addClass('ai-configuration-detail-widget');
61
+ // The page scrolls in its own inner `.ai-configuration-detail-body` (driven by
62
+ // `applyScrollAndHighlight`). Clear the default `ReactWidget` scroll options so that
63
+ // `BaseWidget` does not attach a PerfectScrollbar to the outer node, whose forced
64
+ // `overflow: hidden` and wheel handling would otherwise swallow the inner body's scroll.
65
+ this.scrollOptions = undefined;
66
+ this.toDispose.push(this.selectionModel.onDidChangeSelection(() => this.onSelectionChanged()));
67
+ this.toDispose.push(this.registry.onDidChange(() => this.update()));
68
+ // Also covers the workspace-trust transitions this service reports, which are not preference changes.
69
+ this.toDispose.push(this.aiConfigurationService.onDidChange(() => this.update()));
70
+ // Reflect preference changes made outside the current render pass — most notably the gear menu's
71
+ // Reset command, which runs as a command and so never calls `ctx.update()`. Listening here rather
72
+ // than only to `AiConfigurationService.onDidChange` (scoped to `ai-features.*`) keeps contributed
73
+ // categories up to date too: their preferences carry no AI prefix, so a reset of one used to leave
74
+ // the row's `modified` state stale until the page was re-rendered for some other reason.
75
+ this.toDispose.push(this.preferenceService.onPreferenceChanged(() => this.update()));
76
+ this.update();
77
+ }
78
+
79
+ protected onSelectionChanged(): void {
80
+ this.resetScroll = true;
81
+ this.pendingHighlight = this.selectionModel.getSelection()?.highlight;
82
+ this.pendingHighlightFrames = 0;
83
+ this.update();
84
+ }
85
+
86
+ protected createRenderContext(): AiConfigurationRenderContext {
87
+ return {
88
+ scope: this.scope,
89
+ navigate: selection => this.selectionModel.select(selection),
90
+ update: () => this.update()
91
+ };
92
+ }
93
+
94
+ protected render(): React.ReactNode {
95
+ const selection = this.selectionModel.getSelection();
96
+ const category = selection && this.registry.getCategory(selection.categoryId);
97
+ if (!selection || !category) {
98
+ return this.renderPlaceholder();
99
+ }
100
+ const ctx = this.createRenderContext();
101
+ // The category/item path is shown as real Theia breadcrumbs in the shell tab bar
102
+ // (see AiConfigurationBreadcrumbsContribution), so no in-pane breadcrumb is rendered here.
103
+ return <div className='ai-configuration-detail-container'>
104
+ {this.scope !== 'user' && this.renderScopeBanner()}
105
+ <div className='ai-configuration-detail-body'>
106
+ {this.renderBody(category, selection, ctx)}
107
+ </div>
108
+ </div>;
109
+ }
110
+
111
+ /**
112
+ * Selects the category whose item just disappeared. Deferred to a microtask: this runs during render, and
113
+ * selecting synchronously would re-enter the widget's update while React is still committing this one.
114
+ */
115
+ protected selectCategoryAfterItemLoss(category: AiConfigurationCategory): void {
116
+ queueMicrotask(() => {
117
+ const selection = this.selectionModel.getSelection();
118
+ if (selection?.categoryId === category.id && selection.itemId) {
119
+ this.selectionModel.select({ categoryId: category.id });
120
+ }
121
+ });
122
+ }
123
+
124
+ protected renderScopeBanner(): React.ReactNode {
125
+ return <div className='ai-configuration-detail-scope-banner'>
126
+ <span className={codicon('info')}></span>
127
+ <span>{nls.localize('theia/ai/core/aiConfiguration/scopeBanner', 'Editing the {0} scope.', this.scope)}</span>
128
+ </div>;
129
+ }
130
+
131
+ protected renderBody(category: AiConfigurationCategory, selection: AiConfigurationSelection, ctx: AiConfigurationRenderContext): React.ReactNode {
132
+ const renderer = category.renderer;
133
+ // Item detail pages render their own header (id/status/actions), so they are returned as-is.
134
+ if (selection.itemId && renderer.renderItemDetail) {
135
+ const detail = renderer.renderItemDetail(selection.itemId, ctx);
136
+ if (detail) {
137
+ return detail;
138
+ }
139
+ // The item is gone (deleted while its page was open, e.g. an MCP server) and the renderer has
140
+ // nothing to show, which would leave a blank pane. Fall back to the category, and move the
141
+ // selection there so the tree and breadcrumbs agree with what is displayed.
142
+ this.selectCategoryAfterItemLoss(category);
143
+ }
144
+ // Category-level pages/overviews get a shared header showing the category name, so the page is
145
+ // titled in-pane (not only in the breadcrumb tab bar).
146
+ let content: React.ReactNode;
147
+ if (category.kind === 'collection' && renderer.renderOverview) {
148
+ content = renderer.renderOverview(ctx);
149
+ } else if (renderer.renderPage) {
150
+ content = renderer.renderPage(ctx);
151
+ } else {
152
+ content = this.renderComingSoon(category);
153
+ }
154
+ return <>
155
+ {this.renderCategoryHeader(category)}
156
+ {content}
157
+ </>;
158
+ }
159
+
160
+ /** Shared in-pane header for a category-level page: the category icon, name and optional description. */
161
+ protected renderCategoryHeader(category: AiConfigurationCategory): React.ReactNode {
162
+ return <div className='ai-configuration-category-header'>
163
+ <AiConfigurationItemDetailHeader title={category.label} iconClass={category.iconClass} subtitle={category.description} />
164
+ </div>;
165
+ }
166
+
167
+ protected renderComingSoon(category: AiConfigurationCategory): React.ReactNode {
168
+ return <div className='ai-configuration-detail-placeholder'>
169
+ {nls.localize('theia/ai/core/aiConfiguration/categoryComingSoon', '{0} configuration is not available yet.', category.label)}
170
+ </div>;
171
+ }
172
+
173
+ protected renderPlaceholder(): React.ReactNode {
174
+ return <div className='ai-configuration-detail-placeholder'>
175
+ {nls.localize('theia/ai/core/aiConfiguration/selectCategory', 'Select a category to configure.')}
176
+ </div>;
177
+ }
178
+
179
+ protected override onUpdateRequest(msg: Message): void {
180
+ super.onUpdateRequest(msg);
181
+ this.applyScrollAndHighlight();
182
+ }
183
+
184
+ protected applyScrollAndHighlight(): void {
185
+ if (typeof window === 'undefined' || typeof window.requestAnimationFrame !== 'function') {
186
+ return;
187
+ }
188
+ window.requestAnimationFrame(() => {
189
+ const body = this.node.querySelector<HTMLElement>('.ai-configuration-detail-body');
190
+ if (!body) {
191
+ return;
192
+ }
193
+ if (this.resetScroll && !this.pendingHighlight) {
194
+ body.scrollTop = 0;
195
+ }
196
+ this.resetScroll = false;
197
+ const highlight = this.pendingHighlight;
198
+ if (!highlight) {
199
+ return;
200
+ }
201
+ const element = body.querySelector<HTMLElement>(`[data-ai-config-row-id="${highlight.rowId}"]`);
202
+ if (element) {
203
+ this.pendingHighlight = undefined;
204
+ this.centerInBody(body, element);
205
+ element.classList.add('ai-configuration-row-flash');
206
+ window.setTimeout(() => element.classList.remove('ai-configuration-row-flash'), 1200);
207
+ } else if (this.pendingHighlightFrames < AiConfigurationDetailWidget.HIGHLIGHT_RETRY_FRAMES) {
208
+ // Cross-category navigation renders the new page and the highlight target in the same pass,
209
+ // but categories that resolve their rows asynchronously (agents, providers) are still empty on
210
+ // this frame. Keep the highlight pending and look again rather than dropping it, which made
211
+ // scroll-and-flash fire only when the row happened to be mounted already.
212
+ this.pendingHighlightFrames++;
213
+ this.applyScrollAndHighlight();
214
+ } else {
215
+ this.pendingHighlight = undefined;
216
+ }
217
+ });
218
+ }
219
+
220
+ /**
221
+ * Vertically centers `element` within `body` by scrolling that container and nothing else.
222
+ *
223
+ * Deliberately not `Element.scrollIntoView`: that scrolls *every* scrollable ancestor to satisfy the
224
+ * requested alignment, and `overflow: hidden` does not prevent programmatic scrolling. When a row cannot
225
+ * be centered inside the body alone, it therefore nudges the `overflow: hidden` containers above this
226
+ * widget, which have no scrollbar for the user to scroll back — shifting the whole shell, pushing the menu
227
+ * bar out of view and leaving a gap below the status bar.
228
+ */
229
+ protected centerInBody(body: HTMLElement, element: HTMLElement): void {
230
+ const bodyRect = body.getBoundingClientRect();
231
+ const elementRect = element.getBoundingClientRect();
232
+ const current = elementRect.top - bodyRect.top;
233
+ const centered = (body.clientHeight - elementRect.height) / 2;
234
+ // Assigning `scrollTop` clamps to the scrollable range, so short pages simply do not scroll.
235
+ body.scrollTop += current - centered;
236
+ }
237
+ }
@@ -0,0 +1,47 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { nls } from '@theia/core';
18
+ import { codicon } from '@theia/core/lib/browser';
19
+ import { LabelProviderContribution } from '@theia/core/lib/browser/label-provider';
20
+ import URI from '@theia/core/lib/common/uri';
21
+ import { injectable } from '@theia/core/shared/inversify';
22
+ import { AI_CONFIGURATION_RESOURCE_SCHEME } from './ai-configuration-resource';
23
+
24
+ /**
25
+ * Labels the AI Configuration view's constant resource URI (see {@link AI_CONFIGURATION_RESOURCE_URI}).
26
+ * The view is a {@link NavigatableWidget} so the shell renders breadcrumbs for it; without this, the
27
+ * window title updater would fall back to the URI's (empty) path and show `/` instead of a readable name.
28
+ */
29
+ @injectable()
30
+ export class AiConfigurationLabelProviderContribution implements LabelProviderContribution {
31
+
32
+ canHandle(element: object): number {
33
+ return element instanceof URI && element.scheme === AI_CONFIGURATION_RESOURCE_SCHEME ? 200 : 0;
34
+ }
35
+
36
+ getName(): string {
37
+ return nls.localize('theia/ai/ide/aiConfiguration/breadcrumbRoot', 'AI Configuration');
38
+ }
39
+
40
+ getLongName(): string {
41
+ return this.getName();
42
+ }
43
+
44
+ getIcon(): string {
45
+ return codicon('settings-gear');
46
+ }
47
+ }
@@ -0,0 +1,64 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { inject, injectable, interfaces } from '@theia/core/shared/inversify';
18
+ import { CommandService, nls } from '@theia/core';
19
+ import { AI_CONFIGURATION_OPEN_PREFERENCE_ID } from '@theia/ai-core/lib/browser';
20
+ import { PreferenceLeafNodeRenderer, PreferenceNodeRenderer } from '@theia/preferences/lib/browser/views/components/preference-node-renderer';
21
+ import { PreferenceLeafNodeRendererContribution } from '@theia/preferences/lib/browser/views/components/preference-node-renderer-creator';
22
+ import { Preference } from '@theia/preferences/lib/browser/util/preference-types';
23
+ import { OPEN_AI_CONFIG_VIEW } from './ai-configuration-view-contribution';
24
+
25
+ /**
26
+ * Renders the {@link AI_CONFIGURATION_OPEN_PREFERENCE_ID} placeholder (shown where the AI
27
+ * preferences used to live in the Settings UI) as a button that opens the AI Configuration view.
28
+ */
29
+ @injectable()
30
+ export class AiConfigurationOpenPreferenceRenderer extends PreferenceLeafNodeRenderer<null, HTMLElement> {
31
+
32
+ @inject(CommandService)
33
+ protected readonly commandService: CommandService;
34
+
35
+ protected createInteractable(container: HTMLElement): void {
36
+ const button = document.createElement('button');
37
+ button.classList.add('theia-button', 'main');
38
+ button.textContent = nls.localize('theia/ai/ide/aiConfiguration/openButton', 'Open AI Configuration');
39
+ button.onclick = () => this.commandService.executeCommand(OPEN_AI_CONFIG_VIEW.id);
40
+ this.interactable = button;
41
+ container.appendChild(button);
42
+ }
43
+
44
+ protected getFallbackValue(): null {
45
+ // eslint-disable-next-line no-null/no-null
46
+ return null;
47
+ }
48
+
49
+ protected doHandleValueChange(): void { }
50
+ }
51
+
52
+ @injectable()
53
+ export class AiConfigurationOpenPreferenceRendererContribution extends PreferenceLeafNodeRendererContribution {
54
+ static ID = 'ai-configuration-open-preference-renderer';
55
+ id = AiConfigurationOpenPreferenceRendererContribution.ID;
56
+
57
+ canHandleLeafNode(node: Preference.LeafNode): number {
58
+ return node.preferenceId === AI_CONFIGURATION_OPEN_PREFERENCE_ID ? 100 : 0;
59
+ }
60
+
61
+ createLeafNodeRenderer(container: interfaces.Container): PreferenceNodeRenderer {
62
+ return container.get(AiConfigurationOpenPreferenceRenderer);
63
+ }
64
+ }
@@ -0,0 +1,135 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { enableJSDOM } from '@theia/core/lib/browser/test/jsdom';
18
+ let disableJSDOM = enableJSDOM();
19
+
20
+ // @lumino/dragdrop (pulled in transitively by the categories) extends the DragEvent DOM global at
21
+ // module load, which JSDOM does not provide; stub it so the imports succeed.
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ if (!(global as any).DragEvent) {
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ (global as any).DragEvent = class DragEvent extends (global as any).Event { };
26
+ }
27
+
28
+ import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
29
+ // Mocha loads every spec into one process and `set` throws if called twice, so guard it.
30
+ try {
31
+ FrontendApplicationConfigProvider.get();
32
+ } catch {
33
+ FrontendApplicationConfigProvider.set({});
34
+ }
35
+
36
+ import { expect } from 'chai';
37
+ import { PreferenceSchema } from '@theia/core';
38
+ import { aiCorePreferenceSchema } from '@theia/ai-core/lib/common/ai-core-preferences';
39
+ import { AgentSettingsPreferenceSchema } from '@theia/ai-core/lib/common/agent-preferences';
40
+ import { aiChatPreferences } from '@theia/ai-chat/lib/common/ai-chat-preferences';
41
+ import { chatToolPreferences } from '@theia/ai-chat/lib/common/chat-tool-preferences';
42
+ import { shellCommandPreferences } from '@theia/ai-terminal/lib/common/shell-command-preferences';
43
+ import { aiIdePreferenceSchema } from '../../common/ai-ide-preferences';
44
+ import { GeneralConfigurationCategory } from './categories/general-configuration-category';
45
+ import { AgentsConfigurationCategory } from './categories/agents-configuration-category';
46
+ import { ToolsConfigurationCategory } from './categories/tools-configuration-category';
47
+ import { ModelAliasesConfigurationCategory } from './categories/model-aliases-configuration-category';
48
+ import { PromptsAndSkillsConfigurationCategory } from './categories/prompts-and-skills-configuration-category';
49
+
50
+ disableJSDOM();
51
+
52
+ /**
53
+ * The schemas that declare the `ai-features.*` preferences the categories below claim. Kept explicit
54
+ * rather than read from a live `PreferenceSchemaService`, so the check does not depend on DI.
55
+ */
56
+ const SCHEMAS: PreferenceSchema[] = [
57
+ aiCorePreferenceSchema,
58
+ AgentSettingsPreferenceSchema,
59
+ aiChatPreferences,
60
+ chatToolPreferences,
61
+ shellCommandPreferences,
62
+ aiIdePreferenceSchema
63
+ ];
64
+
65
+ /**
66
+ * Categories with a statically declared ownership list. `ModelsConfigurationCategory` derives its ids
67
+ * from the registered schema at runtime and `McpServersConfigurationCategory` lives in `@theia/ai-mcp`
68
+ * (not a dependency of this package), so neither is covered here.
69
+ */
70
+ function ownershipByCategory(): Map<string, string[]> {
71
+ const categories = [
72
+ new GeneralConfigurationCategory(),
73
+ new AgentsConfigurationCategory(),
74
+ new ToolsConfigurationCategory(),
75
+ new ModelAliasesConfigurationCategory(),
76
+ new PromptsAndSkillsConfigurationCategory()
77
+ ];
78
+ return new Map(categories.map(category => [category.id, category.getOwnedPreferenceIds()]));
79
+ }
80
+
81
+ describe('AI configuration preference ownership', () => {
82
+
83
+ before(() => disableJSDOM = enableJSDOM());
84
+ after(() => disableJSDOM());
85
+
86
+ it('reads a non-empty schema and ownership set (guards the checks below against passing vacuously)', () => {
87
+ const declared = SCHEMAS.flatMap(schema => Object.keys(schema.properties ?? {}));
88
+ expect(declared).to.include('ai-features.AiEnable.enableAI');
89
+ for (const [categoryId, ownedIds] of ownershipByCategory()) {
90
+ expect(ownedIds, `${categoryId} declares no owned preference ids`).to.not.be.empty;
91
+ }
92
+ });
93
+
94
+ it('claims only preference ids that a schema actually declares', () => {
95
+ const declared = new Set(SCHEMAS.flatMap(schema => Object.keys(schema.properties ?? {})));
96
+ const unknown: string[] = [];
97
+ for (const [categoryId, ownedIds] of ownershipByCategory()) {
98
+ for (const preferenceId of ownedIds) {
99
+ if (!declared.has(preferenceId)) {
100
+ unknown.push(`${categoryId} -> ${preferenceId}`);
101
+ }
102
+ }
103
+ }
104
+ // A typo or a renamed preference makes the id unclaimed, so General's catch-all silently renders it
105
+ // a second time. Nothing else fails, which is why this is worth asserting.
106
+ expect(unknown, `categories claim preference ids that no schema declares: ${unknown.join(', ')}`).to.be.empty;
107
+ });
108
+
109
+ it('never lets two categories claim the same preference id', () => {
110
+ const owners = new Map<string, string[]>();
111
+ for (const [categoryId, ownedIds] of ownershipByCategory()) {
112
+ for (const preferenceId of ownedIds) {
113
+ owners.set(preferenceId, [...(owners.get(preferenceId) ?? []), categoryId]);
114
+ }
115
+ }
116
+ const contested = [...owners.entries()]
117
+ .filter(([, categoryIds]) => categoryIds.length > 1)
118
+ .map(([preferenceId, categoryIds]) => `${preferenceId} (${categoryIds.join(', ')})`);
119
+ expect(contested, `preference ids claimed more than once: ${contested.join(', ')}`).to.be.empty;
120
+ });
121
+
122
+ it('claims every id it renders as a row, so the General catch-all does not duplicate it', () => {
123
+ // The ownership contract only holds if a category claims what it renders. Spot-check the two
124
+ // categories whose rows are hand-authored (rather than derived from their ownership list).
125
+ const general = new GeneralConfigurationCategory();
126
+ const agents = new AgentsConfigurationCategory();
127
+ const generalOwned = new Set(general.getOwnedPreferenceIds());
128
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
+ const generalRendered = ((general as any).getSectionRefs() as { preferenceId: string }[]).map(ref => ref.preferenceId);
130
+ const missing = generalRendered.filter(preferenceId => !generalOwned.has(preferenceId));
131
+ expect(missing, `General renders rows it does not claim: ${missing.join(', ')}`).to.be.empty;
132
+ // The agent page's own rows are covered by its ownership list too.
133
+ expect(agents.getOwnedPreferenceIds()).to.include('ai-features.agentSettings');
134
+ });
135
+ });
@@ -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,15 @@
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
16
 
18
- export interface ConfigurationSectionProps {
19
- title: string;
20
- children: React.ReactNode;
21
- className?: string;
22
- }
17
+ import URI from '@theia/core/lib/common/uri';
18
+
19
+ /** URI scheme identifying the AI Configuration view for Theia's breadcrumbs infrastructure. */
20
+ export const AI_CONFIGURATION_RESOURCE_SCHEME = 'ai-configuration';
23
21
 
24
22
  /**
25
- * A reusable section component with a title and content area.
26
- * Follows the Theia settings section styling.
23
+ * The stable resource URI of the AI Configuration view. It is constant (the current
24
+ * category/item is read from the selection model), mirroring how an editor keeps its file URI
25
+ * while its breadcrumb content changes with the cursor.
27
26
  */
28
- export const ConfigurationSection: React.FC<ConfigurationSectionProps> = ({ title, children, className }) => (
29
- <div className={`ai-configuration-section ${className || ''}`}>
30
- <div className='settings-section-title settings-section-category-title'>
31
- {title}
32
- </div>
33
- <div className='ai-configuration-section-content'>
34
- {children}
35
- </div>
36
- </div>
37
- );
27
+ export const AI_CONFIGURATION_RESOURCE_URI = new URI(`${AI_CONFIGURATION_RESOURCE_SCHEME}:/`);
@@ -0,0 +1,135 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import * as React from '@theia/core/shared/react';
18
+ import { Emitter, Event, nls } from '@theia/core';
19
+ import { injectable, postConstruct } from '@theia/core/shared/inversify';
20
+ import { codicon, ReactWidget } from '@theia/core/lib/browser';
21
+
22
+ /**
23
+ * The search box above the category tree. It emits {@link onDidChangeFilter} so the tree can
24
+ * live-filter its nodes; filtering the tree is the only search affordance.
25
+ */
26
+ @injectable()
27
+ export class AiConfigurationSearchWidget extends ReactWidget {
28
+
29
+ static readonly ID = 'ai-configuration-search';
30
+
31
+ protected readonly onDidChangeFilterEmitter = new Emitter<string>();
32
+ readonly onDidChangeFilter: Event<string> = this.onDidChangeFilterEmitter.event;
33
+
34
+ protected readonly onDidRequestExpandAllEmitter = new Emitter<void>();
35
+ /** Fired by the "Expand All" toolbar button below the search input. */
36
+ readonly onDidRequestExpandAll: Event<void> = this.onDidRequestExpandAllEmitter.event;
37
+
38
+ protected readonly onDidRequestCollapseAllEmitter = new Emitter<void>();
39
+ /** Fired by the "Collapse All" toolbar button below the search input. */
40
+ readonly onDidRequestCollapseAll: Event<void> = this.onDidRequestCollapseAllEmitter.event;
41
+
42
+ /** Whether the tree has any expandable category, and whether all of them are currently expanded. */
43
+ protected hasExpandable = false;
44
+ protected allExpanded = false;
45
+
46
+ @postConstruct()
47
+ protected init(): void {
48
+ this.id = AiConfigurationSearchWidget.ID;
49
+ this.addClass('ai-configuration-search');
50
+ this.toDispose.push(this.onDidChangeFilterEmitter);
51
+ this.toDispose.push(this.onDidRequestExpandAllEmitter);
52
+ this.toDispose.push(this.onDidRequestCollapseAllEmitter);
53
+ this.update();
54
+ }
55
+
56
+ /** Updates the expand/collapse-all toggle to reflect the tree's current expansion. */
57
+ setTreeExpansion(hasExpandable: boolean, allExpanded: boolean): void {
58
+ if (this.hasExpandable !== hasExpandable || this.allExpanded !== allExpanded) {
59
+ this.hasExpandable = hasExpandable;
60
+ this.allExpanded = allExpanded;
61
+ this.update();
62
+ }
63
+ }
64
+
65
+ protected onExpandAll = (): void => this.onDidRequestExpandAllEmitter.fire();
66
+ protected onCollapseAll = (): void => this.onDidRequestCollapseAllEmitter.fire();
67
+ protected onQueryChange = (query: string): void => this.onDidChangeFilterEmitter.fire(query);
68
+
69
+ protected render(): React.ReactNode {
70
+ return <React.Fragment>
71
+ {/* The input owns its value via React state so the caret is preserved while typing; a
72
+ ReactWidget re-render (e.g. the toolbar toggle below) would otherwise reset the caret. */}
73
+ <AiConfigurationSearchInput onQueryChange={this.onQueryChange} />
74
+ {this.hasExpandable && <div className='ai-configuration-tree-toolbar'>
75
+ {/* A single contextual toggle: Collapse All while everything is expanded, Expand All otherwise. */}
76
+ {this.allExpanded
77
+ ? <button
78
+ type='button'
79
+ className={`ai-configuration-tree-toolbar-button ${codicon('collapse-all')}`}
80
+ title={nls.localizeByDefault('Collapse All')}
81
+ onClick={this.onCollapseAll}
82
+ ></button>
83
+ : <button
84
+ type='button'
85
+ className={`ai-configuration-tree-toolbar-button ${codicon('expand-all')}`}
86
+ title={nls.localizeByDefault('Expand All')}
87
+ onClick={this.onExpandAll}
88
+ ></button>}
89
+ </div>}
90
+ </React.Fragment>;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * The search box, as a functional component so its value lives in React state. Typing therefore preserves
96
+ * the caret position (editing mid-string no longer jumps to the end, which happened when the enclosing
97
+ * ReactWidget re-rendered the controlled input out of band). Notifies the owner via {@link onQueryChange}.
98
+ */
99
+ const AiConfigurationSearchInput: React.FC<{ onQueryChange: (query: string) => void }> = ({ onQueryChange }) => {
100
+ const [query, setQuery] = React.useState('');
101
+ const change = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
102
+ setQuery(event.target.value);
103
+ onQueryChange(event.target.value);
104
+ }, [onQueryChange]);
105
+ const clear = React.useCallback(() => {
106
+ setQuery('');
107
+ onQueryChange('');
108
+ }, [onQueryChange]);
109
+ const onKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {
110
+ if (event.key === 'Escape' && query.length > 0) {
111
+ event.preventDefault();
112
+ clear();
113
+ }
114
+ }, [query, clear]);
115
+ const clearLabel = nls.localizeByDefault('Clear');
116
+ return <div className='ai-configuration-search-wrap'>
117
+ <span className={`ai-configuration-search-icon ${codicon('search')}`}></span>
118
+ <input
119
+ className='theia-input ai-configuration-search-input'
120
+ type='text'
121
+ spellCheck={false}
122
+ placeholder={nls.localize('theia/ai/core/aiConfiguration/searchPlaceholder', 'Search AI settings')}
123
+ value={query}
124
+ onChange={change}
125
+ onKeyDown={onKeyDown}
126
+ />
127
+ {query.length > 0 && <button
128
+ type='button'
129
+ className={`ai-configuration-search-clear ${codicon('close')}`}
130
+ title={clearLabel}
131
+ aria-label={clearLabel}
132
+ onClick={clear}
133
+ ></button>}
134
+ </div>;
135
+ };