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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/README.md +1 -0
  2. package/package.json +21 -21
  3. package/src/browser/ai-configuration/agent-configuration-widget.tsx +3 -3
  4. package/src/browser/file-changeset-functions.spec.ts +13 -13
  5. package/src/browser/file-changeset-functions.ts +9 -9
  6. package/src/browser/frontend-module.ts +7 -4
  7. package/src/browser/ide-chat-welcome-message-provider.tsx +64 -70
  8. package/src/browser/remember-command-contribution.ts +105 -0
  9. package/src/common/ai-ide-preferences.ts +1 -1
  10. package/src/common/coder-replace-prompt-template.ts +8 -9
  11. package/src/common/command-prompt-template.ts +5 -5
  12. package/src/common/file-changeset-function-ids.ts +15 -1
  13. package/src/common/orchestrator-chat-agent.ts +2 -2
  14. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +0 -41
  15. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +0 -1
  16. package/lib/browser/ai-configuration/agent-configuration-widget.js +0 -333
  17. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +0 -1
  18. package/lib/browser/ai-configuration/ai-configuration-service.d.ts +0 -18
  19. package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +0 -1
  20. package/lib/browser/ai-configuration/ai-configuration-service.js +0 -53
  21. package/lib/browser/ai-configuration/ai-configuration-service.js.map +0 -1
  22. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +0 -14
  23. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +0 -1
  24. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +0 -67
  25. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +0 -1
  26. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +0 -29
  27. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +0 -1
  28. package/lib/browser/ai-configuration/ai-configuration-widget.js +0 -118
  29. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +0 -1
  30. package/lib/browser/ai-configuration/language-model-renderer.d.ts +0 -13
  31. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +0 -1
  32. package/lib/browser/ai-configuration/language-model-renderer.js +0 -104
  33. package/lib/browser/ai-configuration/language-model-renderer.js.map +0 -1
  34. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +0 -43
  35. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +0 -1
  36. package/lib/browser/ai-configuration/mcp-configuration-widget.js +0 -302
  37. package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +0 -1
  38. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +0 -41
  39. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +0 -1
  40. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +0 -226
  41. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +0 -1
  42. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -141
  43. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +0 -1
  44. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -508
  45. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +0 -1
  46. package/lib/browser/ai-configuration/template-settings-renderer.d.ts +0 -10
  47. package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +0 -1
  48. package/lib/browser/ai-configuration/template-settings-renderer.js +0 -48
  49. package/lib/browser/ai-configuration/template-settings-renderer.js.map +0 -1
  50. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +0 -22
  51. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +0 -1
  52. package/lib/browser/ai-configuration/token-usage-configuration-widget.js +0 -156
  53. package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +0 -1
  54. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +0 -30
  55. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +0 -1
  56. package/lib/browser/ai-configuration/tools-configuration-widget.js +0 -150
  57. package/lib/browser/ai-configuration/tools-configuration-widget.js.map +0 -1
  58. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +0 -19
  59. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +0 -1
  60. package/lib/browser/ai-configuration/variable-configuration-widget.js +0 -99
  61. package/lib/browser/ai-configuration/variable-configuration-widget.js.map +0 -1
  62. package/lib/browser/ai-ide-activation-service.d.ts +0 -18
  63. package/lib/browser/ai-ide-activation-service.d.ts.map +0 -1
  64. package/lib/browser/ai-ide-activation-service.js +0 -71
  65. package/lib/browser/ai-ide-activation-service.js.map +0 -1
  66. package/lib/browser/ai-terminal-functions.d.ts +0 -13
  67. package/lib/browser/ai-terminal-functions.d.ts.map +0 -1
  68. package/lib/browser/ai-terminal-functions.js +0 -114
  69. package/lib/browser/ai-terminal-functions.js.map +0 -1
  70. package/lib/browser/app-tester-chat-agent.d.ts +0 -35
  71. package/lib/browser/app-tester-chat-agent.d.ts.map +0 -1
  72. package/lib/browser/app-tester-chat-agent.js +0 -142
  73. package/lib/browser/app-tester-chat-agent.js.map +0 -1
  74. package/lib/browser/app-tester-chat-functions.d.ts +0 -25
  75. package/lib/browser/app-tester-chat-functions.d.ts.map +0 -1
  76. package/lib/browser/app-tester-chat-functions.js +0 -170
  77. package/lib/browser/app-tester-chat-functions.js.map +0 -1
  78. package/lib/browser/app-tester-prompt-template.d.ts +0 -6
  79. package/lib/browser/app-tester-prompt-template.d.ts.map +0 -1
  80. package/lib/browser/app-tester-prompt-template.js +0 -83
  81. package/lib/browser/app-tester-prompt-template.js.map +0 -1
  82. package/lib/browser/architect-agent.d.ts +0 -15
  83. package/lib/browser/architect-agent.d.ts.map +0 -1
  84. package/lib/browser/architect-agent.js +0 -68
  85. package/lib/browser/architect-agent.js.map +0 -1
  86. package/lib/browser/coder-agent.d.ts +0 -15
  87. package/lib/browser/coder-agent.d.ts.map +0 -1
  88. package/lib/browser/coder-agent.js +0 -81
  89. package/lib/browser/coder-agent.js.map +0 -1
  90. package/lib/browser/context-file-validation-service-impl.d.ts +0 -13
  91. package/lib/browser/context-file-validation-service-impl.d.ts.map +0 -1
  92. package/lib/browser/context-file-validation-service-impl.js +0 -123
  93. package/lib/browser/context-file-validation-service-impl.js.map +0 -1
  94. package/lib/browser/context-file-validation-service-impl.spec.d.ts +0 -2
  95. package/lib/browser/context-file-validation-service-impl.spec.d.ts.map +0 -1
  96. package/lib/browser/context-file-validation-service-impl.spec.js +0 -340
  97. package/lib/browser/context-file-validation-service-impl.spec.js.map +0 -1
  98. package/lib/browser/context-functions.d.ts +0 -16
  99. package/lib/browser/context-functions.d.ts.map +0 -1
  100. package/lib/browser/context-functions.js +0 -166
  101. package/lib/browser/context-functions.js.map +0 -1
  102. package/lib/browser/context-functions.spec.d.ts +0 -2
  103. package/lib/browser/context-functions.spec.d.ts.map +0 -1
  104. package/lib/browser/context-functions.spec.js +0 -213
  105. package/lib/browser/context-functions.spec.js.map +0 -1
  106. package/lib/browser/file-changeset-function.spec.d.ts +0 -2
  107. package/lib/browser/file-changeset-function.spec.d.ts.map +0 -1
  108. package/lib/browser/file-changeset-function.spec.js +0 -45
  109. package/lib/browser/file-changeset-function.spec.js.map +0 -1
  110. package/lib/browser/file-changeset-functions.d.ts +0 -87
  111. package/lib/browser/file-changeset-functions.d.ts.map +0 -1
  112. package/lib/browser/file-changeset-functions.js +0 -645
  113. package/lib/browser/file-changeset-functions.js.map +0 -1
  114. package/lib/browser/file-changeset-functions.spec.d.ts +0 -2
  115. package/lib/browser/file-changeset-functions.spec.d.ts.map +0 -1
  116. package/lib/browser/file-changeset-functions.spec.js +0 -179
  117. package/lib/browser/file-changeset-functions.spec.js.map +0 -1
  118. package/lib/browser/frontend-module.d.ts +0 -5
  119. package/lib/browser/frontend-module.d.ts.map +0 -1
  120. package/lib/browser/frontend-module.js +0 -218
  121. package/lib/browser/frontend-module.js.map +0 -1
  122. package/lib/browser/github-chat-agent.d.ts +0 -48
  123. package/lib/browser/github-chat-agent.d.ts.map +0 -1
  124. package/lib/browser/github-chat-agent.js +0 -222
  125. package/lib/browser/github-chat-agent.js.map +0 -1
  126. package/lib/browser/github-prompt-template.d.ts +0 -6
  127. package/lib/browser/github-prompt-template.d.ts.map +0 -1
  128. package/lib/browser/github-prompt-template.js +0 -53
  129. package/lib/browser/github-prompt-template.js.map +0 -1
  130. package/lib/browser/github-repo-variable-contribution.d.ts +0 -15
  131. package/lib/browser/github-repo-variable-contribution.d.ts.map +0 -1
  132. package/lib/browser/github-repo-variable-contribution.js +0 -82
  133. package/lib/browser/github-repo-variable-contribution.js.map +0 -1
  134. package/lib/browser/ide-chat-welcome-message-provider.d.ts +0 -11
  135. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +0 -1
  136. package/lib/browser/ide-chat-welcome-message-provider.js +0 -142
  137. package/lib/browser/ide-chat-welcome-message-provider.js.map +0 -1
  138. package/lib/browser/project-info-agent.d.ts +0 -13
  139. package/lib/browser/project-info-agent.d.ts.map +0 -1
  140. package/lib/browser/project-info-agent.js +0 -45
  141. package/lib/browser/project-info-agent.js.map +0 -1
  142. package/lib/browser/summarize-session-command-contribution.d.ts +0 -19
  143. package/lib/browser/summarize-session-command-contribution.d.ts.map +0 -1
  144. package/lib/browser/summarize-session-command-contribution.js +0 -118
  145. package/lib/browser/summarize-session-command-contribution.js.map +0 -1
  146. package/lib/browser/task-background-summary-variable.d.ts +0 -9
  147. package/lib/browser/task-background-summary-variable.d.ts.map +0 -1
  148. package/lib/browser/task-background-summary-variable.js +0 -60
  149. package/lib/browser/task-background-summary-variable.js.map +0 -1
  150. package/lib/browser/task-context-agent.d.ts +0 -13
  151. package/lib/browser/task-context-agent.d.ts.map +0 -1
  152. package/lib/browser/task-context-agent.js +0 -45
  153. package/lib/browser/task-context-agent.js.map +0 -1
  154. package/lib/browser/task-context-file-storage-service.d.ts +0 -40
  155. package/lib/browser/task-context-file-storage-service.d.ts.map +0 -1
  156. package/lib/browser/task-context-file-storage-service.js +0 -232
  157. package/lib/browser/task-context-file-storage-service.js.map +0 -1
  158. package/lib/browser/template-preference-contribution.d.ts +0 -17
  159. package/lib/browser/template-preference-contribution.d.ts.map +0 -1
  160. package/lib/browser/template-preference-contribution.js +0 -94
  161. package/lib/browser/template-preference-contribution.js.map +0 -1
  162. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +0 -2
  163. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +0 -1
  164. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +0 -52
  165. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +0 -1
  166. package/lib/browser/workspace-functions.d.ts +0 -78
  167. package/lib/browser/workspace-functions.d.ts.map +0 -1
  168. package/lib/browser/workspace-functions.js +0 -697
  169. package/lib/browser/workspace-functions.js.map +0 -1
  170. package/lib/browser/workspace-functions.spec.d.ts +0 -2
  171. package/lib/browser/workspace-functions.spec.d.ts.map +0 -1
  172. package/lib/browser/workspace-functions.spec.js +0 -161
  173. package/lib/browser/workspace-functions.spec.js.map +0 -1
  174. package/lib/browser/workspace-launch-provider.d.ts +0 -24
  175. package/lib/browser/workspace-launch-provider.d.ts.map +0 -1
  176. package/lib/browser/workspace-launch-provider.js +0 -216
  177. package/lib/browser/workspace-launch-provider.js.map +0 -1
  178. package/lib/browser/workspace-launch-provider.spec.d.ts +0 -2
  179. package/lib/browser/workspace-launch-provider.spec.d.ts.map +0 -1
  180. package/lib/browser/workspace-launch-provider.spec.js +0 -245
  181. package/lib/browser/workspace-launch-provider.spec.js.map +0 -1
  182. package/lib/browser/workspace-search-provider.d.ts +0 -15
  183. package/lib/browser/workspace-search-provider.d.ts.map +0 -1
  184. package/lib/browser/workspace-search-provider.js +0 -204
  185. package/lib/browser/workspace-search-provider.js.map +0 -1
  186. package/lib/browser/workspace-search-provider.spec.d.ts +0 -2
  187. package/lib/browser/workspace-search-provider.spec.d.ts.map +0 -1
  188. package/lib/browser/workspace-search-provider.spec.js +0 -82
  189. package/lib/browser/workspace-search-provider.spec.js.map +0 -1
  190. package/lib/browser/workspace-task-provider.d.ts +0 -15
  191. package/lib/browser/workspace-task-provider.d.ts.map +0 -1
  192. package/lib/browser/workspace-task-provider.js +0 -138
  193. package/lib/browser/workspace-task-provider.js.map +0 -1
  194. package/lib/browser/workspace-task-provider.spec.d.ts +0 -2
  195. package/lib/browser/workspace-task-provider.spec.d.ts.map +0 -1
  196. package/lib/browser/workspace-task-provider.spec.js +0 -109
  197. package/lib/browser/workspace-task-provider.spec.js.map +0 -1
  198. package/lib/common/ai-configuration-preferences.d.ts +0 -8
  199. package/lib/common/ai-configuration-preferences.d.ts.map +0 -1
  200. package/lib/common/ai-configuration-preferences.js +0 -41
  201. package/lib/common/ai-configuration-preferences.js.map +0 -1
  202. package/lib/common/ai-ide-preferences.d.ts +0 -5
  203. package/lib/common/ai-ide-preferences.d.ts.map +0 -1
  204. package/lib/common/ai-ide-preferences.js +0 -53
  205. package/lib/common/ai-ide-preferences.js.map +0 -1
  206. package/lib/common/ai-terminal-functions.d.ts +0 -2
  207. package/lib/common/ai-terminal-functions.d.ts.map +0 -1
  208. package/lib/common/ai-terminal-functions.js +0 -20
  209. package/lib/common/ai-terminal-functions.js.map +0 -1
  210. package/lib/common/app-tester-chat-functions.d.ts +0 -5
  211. package/lib/common/app-tester-chat-functions.d.ts.map +0 -1
  212. package/lib/common/app-tester-chat-functions.js +0 -23
  213. package/lib/common/app-tester-chat-functions.js.map +0 -1
  214. package/lib/common/architect-prompt-template.d.ts +0 -3
  215. package/lib/common/architect-prompt-template.d.ts.map +0 -1
  216. package/lib/common/architect-prompt-template.js +0 -81
  217. package/lib/common/architect-prompt-template.js.map +0 -1
  218. package/lib/common/browser-automation-protocol.d.ts +0 -15
  219. package/lib/common/browser-automation-protocol.d.ts.map +0 -1
  220. package/lib/common/browser-automation-protocol.js +0 -22
  221. package/lib/common/browser-automation-protocol.js.map +0 -1
  222. package/lib/common/coder-replace-prompt-template.d.ts +0 -11
  223. package/lib/common/coder-replace-prompt-template.d.ts.map +0 -1
  224. package/lib/common/coder-replace-prompt-template.js +0 -295
  225. package/lib/common/coder-replace-prompt-template.js.map +0 -1
  226. package/lib/common/command-chat-agents.d.ts +0 -36
  227. package/lib/common/command-chat-agents.d.ts.map +0 -1
  228. package/lib/common/command-chat-agents.js +0 -122
  229. package/lib/common/command-chat-agents.js.map +0 -1
  230. package/lib/common/command-prompt-template.d.ts +0 -3
  231. package/lib/common/command-prompt-template.d.ts.map +0 -1
  232. package/lib/common/command-prompt-template.js +0 -226
  233. package/lib/common/command-prompt-template.js.map +0 -1
  234. package/lib/common/context-files-variable.d.ts +0 -9
  235. package/lib/common/context-files-variable.d.ts.map +0 -1
  236. package/lib/common/context-files-variable.js +0 -52
  237. package/lib/common/context-files-variable.js.map +0 -1
  238. package/lib/common/context-functions.d.ts +0 -4
  239. package/lib/common/context-functions.d.ts.map +0 -1
  240. package/lib/common/context-functions.js +0 -22
  241. package/lib/common/context-functions.js.map +0 -1
  242. package/lib/common/context-variables.d.ts +0 -3
  243. package/lib/common/context-variables.d.ts.map +0 -1
  244. package/lib/common/context-variables.js +0 -21
  245. package/lib/common/context-variables.js.map +0 -1
  246. package/lib/common/file-changeset-function-ids.d.ts +0 -8
  247. package/lib/common/file-changeset-function-ids.d.ts.map +0 -1
  248. package/lib/common/file-changeset-function-ids.js +0 -26
  249. package/lib/common/file-changeset-function-ids.js.map +0 -1
  250. package/lib/common/github-repo-protocol.d.ts +0 -15
  251. package/lib/common/github-repo-protocol.d.ts.map +0 -1
  252. package/lib/common/github-repo-protocol.js +0 -21
  253. package/lib/common/github-repo-protocol.js.map +0 -1
  254. package/lib/common/orchestrator-chat-agent.d.ts +0 -36
  255. package/lib/common/orchestrator-chat-agent.d.ts.map +0 -1
  256. package/lib/common/orchestrator-chat-agent.js +0 -167
  257. package/lib/common/orchestrator-chat-agent.js.map +0 -1
  258. package/lib/common/orchestrator-prompt-template.d.ts +0 -3
  259. package/lib/common/orchestrator-prompt-template.d.ts.map +0 -1
  260. package/lib/common/orchestrator-prompt-template.js +0 -55
  261. package/lib/common/orchestrator-prompt-template.js.map +0 -1
  262. package/lib/common/project-info-prompt-template.d.ts +0 -6
  263. package/lib/common/project-info-prompt-template.d.ts.map +0 -1
  264. package/lib/common/project-info-prompt-template.js +0 -145
  265. package/lib/common/project-info-prompt-template.js.map +0 -1
  266. package/lib/common/summarize-session-commands.d.ts +0 -4
  267. package/lib/common/summarize-session-commands.d.ts.map +0 -1
  268. package/lib/common/summarize-session-commands.js +0 -28
  269. package/lib/common/summarize-session-commands.js.map +0 -1
  270. package/lib/common/task-context-prompt-template.d.ts +0 -8
  271. package/lib/common/task-context-prompt-template.d.ts.map +0 -1
  272. package/lib/common/task-context-prompt-template.js +0 -217
  273. package/lib/common/task-context-prompt-template.js.map +0 -1
  274. package/lib/common/universal-chat-agent.d.ts +0 -17
  275. package/lib/common/universal-chat-agent.d.ts.map +0 -1
  276. package/lib/common/universal-chat-agent.js +0 -47
  277. package/lib/common/universal-chat-agent.js.map +0 -1
  278. package/lib/common/universal-prompt-template.d.ts +0 -4
  279. package/lib/common/universal-prompt-template.d.ts.map +0 -1
  280. package/lib/common/universal-prompt-template.js +0 -32
  281. package/lib/common/universal-prompt-template.js.map +0 -1
  282. package/lib/common/workspace-functions.d.ts +0 -12
  283. package/lib/common/workspace-functions.d.ts.map +0 -1
  284. package/lib/common/workspace-functions.js +0 -30
  285. package/lib/common/workspace-functions.js.map +0 -1
  286. package/lib/common/workspace-preferences.d.ts +0 -10
  287. package/lib/common/workspace-preferences.d.ts.map +0 -1
  288. package/lib/common/workspace-preferences.js +0 -89
  289. package/lib/common/workspace-preferences.js.map +0 -1
  290. package/lib/common/workspace-search-provider-util.d.ts +0 -17
  291. package/lib/common/workspace-search-provider-util.d.ts.map +0 -1
  292. package/lib/common/workspace-search-provider-util.js +0 -51
  293. package/lib/common/workspace-search-provider-util.js.map +0 -1
  294. package/lib/node/app-tester-agent/browser-automation-impl.d.ts +0 -18
  295. package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +0 -1
  296. package/lib/node/app-tester-agent/browser-automation-impl.js +0 -96
  297. package/lib/node/app-tester-agent/browser-automation-impl.js.map +0 -1
  298. package/lib/node/backend-module.d.ts +0 -4
  299. package/lib/node/backend-module.d.ts.map +0 -1
  300. package/lib/node/backend-module.js +0 -45
  301. package/lib/node/backend-module.js.map +0 -1
  302. package/lib/node/github-repo-service-impl.d.ts +0 -7
  303. package/lib/node/github-repo-service-impl.d.ts.map +0 -1
  304. package/lib/node/github-repo-service-impl.js +0 -86
  305. package/lib/node/github-repo-service-impl.js.map +0 -1
  306. package/lib/package.spec.d.ts +0 -1
  307. package/lib/package.spec.d.ts.map +0 -1
  308. package/lib/package.spec.js +0 -26
  309. package/lib/package.spec.js.map +0 -1
@@ -1,245 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
19
- let disableJSDOM = (0, jsdom_1.enableJSDOM)();
20
- const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
21
- frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
22
- const chai_1 = require("chai");
23
- const inversify_1 = require("@theia/core/shared/inversify");
24
- const workspace_launch_provider_1 = require("./workspace-launch-provider");
25
- const debug_configuration_manager_1 = require("@theia/debug/lib/browser/debug-configuration-manager");
26
- const debug_session_manager_1 = require("@theia/debug/lib/browser/debug-session-manager");
27
- const debug_session_options_1 = require("@theia/debug/lib/browser/debug-session-options");
28
- disableJSDOM();
29
- describe('Launch Management Tool Providers', () => {
30
- let container;
31
- let launchListProvider;
32
- let launchRunnerProvider;
33
- let launchStopProvider;
34
- let mockDebugConfigurationManager;
35
- let mockDebugSessionManager;
36
- before(() => {
37
- disableJSDOM = (0, jsdom_1.enableJSDOM)();
38
- });
39
- after(() => {
40
- disableJSDOM();
41
- });
42
- beforeEach(() => {
43
- container = new inversify_1.Container();
44
- const mockConfigs = createMockConfigurations();
45
- mockDebugConfigurationManager = {
46
- load: () => Promise.resolve(),
47
- get all() {
48
- function* configIterator() {
49
- for (const config of mockConfigs) {
50
- yield config;
51
- }
52
- }
53
- return configIterator();
54
- },
55
- };
56
- mockDebugSessionManager = {
57
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
- start: async (options) => {
59
- if (typeof options === 'string' ||
60
- debug_session_options_1.DebugSessionOptions.isCompound(options)) {
61
- return true;
62
- }
63
- return {
64
- id: 'test-session-id',
65
- configuration: { name: 'Test Config' },
66
- };
67
- },
68
- terminateSession: () => Promise.resolve(),
69
- currentSession: undefined,
70
- sessions: [],
71
- };
72
- container
73
- .bind(debug_configuration_manager_1.DebugConfigurationManager)
74
- .toConstantValue(mockDebugConfigurationManager);
75
- container
76
- .bind(debug_session_manager_1.DebugSessionManager)
77
- .toConstantValue(mockDebugSessionManager);
78
- launchListProvider = container.resolve(workspace_launch_provider_1.LaunchListProvider);
79
- launchRunnerProvider = container.resolve(workspace_launch_provider_1.LaunchRunnerProvider);
80
- launchStopProvider = container.resolve(workspace_launch_provider_1.LaunchStopProvider);
81
- });
82
- function createMockConfigurations() {
83
- const config1 = {
84
- name: 'Node.js Debug',
85
- type: 'node',
86
- request: 'launch',
87
- program: '${workspaceFolder}/app.js',
88
- };
89
- const config2 = {
90
- name: 'Python Debug',
91
- type: 'python',
92
- request: 'launch',
93
- program: '${workspaceFolder}/main.py',
94
- };
95
- const compound = {
96
- name: 'Launch All',
97
- configurations: ['Node.js Debug', 'Python Debug'],
98
- };
99
- return [
100
- {
101
- name: 'Node.js Debug',
102
- configuration: config1,
103
- workspaceFolderUri: '/workspace',
104
- },
105
- {
106
- name: 'Python Debug',
107
- configuration: config2,
108
- workspaceFolderUri: '/workspace',
109
- },
110
- { name: 'Launch All', compound, workspaceFolderUri: '/workspace' },
111
- ];
112
- }
113
- describe('LaunchListProvider', () => {
114
- it('should provide the correct tool metadata', () => {
115
- const tool = launchListProvider.getTool();
116
- (0, chai_1.expect)(tool.id).to.equal('listLaunchConfigurations');
117
- (0, chai_1.expect)(tool.name).to.equal('listLaunchConfigurations');
118
- (0, chai_1.expect)(tool.description).to.contain('Lists available launch configurations');
119
- (0, chai_1.expect)(tool.parameters.required).to.deep.equal(['filter']);
120
- });
121
- it('should list all configurations without filter', async () => {
122
- const tool = launchListProvider.getTool();
123
- const result = await tool.handler('{"filter":""}');
124
- (0, chai_1.expect)(result).to.be.a('string');
125
- const configurations = JSON.parse(result);
126
- (0, chai_1.expect)(configurations).to.be.an('array');
127
- (0, chai_1.expect)(configurations).to.have.lengthOf(3);
128
- (0, chai_1.expect)(configurations).to.include('Node.js Debug');
129
- (0, chai_1.expect)(configurations).to.include('Python Debug');
130
- (0, chai_1.expect)(configurations).to.include('Launch All');
131
- });
132
- it('should filter configurations by name', async () => {
133
- const tool = launchListProvider.getTool();
134
- const result = await tool.handler('{"filter":"Node"}');
135
- (0, chai_1.expect)(result).to.be.a('string');
136
- const configurations = JSON.parse(result);
137
- (0, chai_1.expect)(configurations).to.be.an('array');
138
- (0, chai_1.expect)(configurations).to.have.lengthOf(1);
139
- (0, chai_1.expect)(configurations).to.include('Node.js Debug');
140
- });
141
- it('should handle case-insensitive filtering', async () => {
142
- const tool = launchListProvider.getTool();
143
- const result = await tool.handler('{"filter":"python"}');
144
- (0, chai_1.expect)(result).to.be.a('string');
145
- const configurations = JSON.parse(result);
146
- (0, chai_1.expect)(configurations).to.be.an('array');
147
- (0, chai_1.expect)(configurations).to.have.lengthOf(1);
148
- (0, chai_1.expect)(configurations).to.include('Python Debug');
149
- });
150
- });
151
- describe('LaunchRunnerProvider', () => {
152
- it('should provide the correct tool metadata', () => {
153
- const tool = launchRunnerProvider.getTool();
154
- (0, chai_1.expect)(tool.id).to.equal('runLaunchConfiguration');
155
- (0, chai_1.expect)(tool.name).to.equal('runLaunchConfiguration');
156
- (0, chai_1.expect)(tool.description).to.contain('Executes a specified launch configuration');
157
- (0, chai_1.expect)(tool.parameters.required).to.deep.equal([
158
- 'configurationName',
159
- ]);
160
- });
161
- it('should start a valid configuration', async () => {
162
- const tool = launchRunnerProvider.getTool();
163
- const result = await tool.handler('{"configurationName":"Node.js Debug"}');
164
- (0, chai_1.expect)(result).to.be.a('string');
165
- (0, chai_1.expect)(result).to.contain('Node.js Debug');
166
- (0, chai_1.expect)(result).to.contain('started with session ID');
167
- });
168
- it('should handle unknown configuration', async () => {
169
- const tool = launchRunnerProvider.getTool();
170
- const result = await tool.handler('{"configurationName":"Unknown Config"}');
171
- (0, chai_1.expect)(result).to.be.a('string');
172
- (0, chai_1.expect)(result).to.contain('Did not find a launch configuration');
173
- (0, chai_1.expect)(result).to.contain('Unknown Config');
174
- });
175
- it('should handle compound configurations', async () => {
176
- const tool = launchRunnerProvider.getTool();
177
- const result = await tool.handler('{"configurationName":"Launch All"}');
178
- (0, chai_1.expect)(result).to.be.a('string');
179
- (0, chai_1.expect)(result).to.contain('Compound launch configuration');
180
- (0, chai_1.expect)(result).to.contain('Launch All');
181
- (0, chai_1.expect)(result).to.contain('started successfully');
182
- });
183
- });
184
- describe('LaunchStopProvider', () => {
185
- it('should provide the correct tool metadata', () => {
186
- const tool = launchStopProvider.getTool();
187
- (0, chai_1.expect)(tool.id).to.equal('stopLaunchConfiguration');
188
- (0, chai_1.expect)(tool.name).to.equal('stopLaunchConfiguration');
189
- (0, chai_1.expect)(tool.description).to.contain('Stops an active launch configuration');
190
- (0, chai_1.expect)(tool.parameters.required).to.deep.equal([]);
191
- });
192
- it('should stop current session when no configuration name provided', async () => {
193
- mockDebugSessionManager.currentSession = {
194
- id: 'current-session',
195
- configuration: { name: 'Current Config' },
196
- };
197
- const tool = launchStopProvider.getTool();
198
- const result = await tool.handler('{}');
199
- (0, chai_1.expect)(result).to.be.a('string');
200
- (0, chai_1.expect)(result).to.contain('Successfully stopped current debug session');
201
- (0, chai_1.expect)(result).to.contain('Current Config');
202
- });
203
- it('should handle no active session', async () => {
204
- mockDebugSessionManager.currentSession = undefined;
205
- const tool = launchStopProvider.getTool();
206
- const result = await tool.handler('{}');
207
- (0, chai_1.expect)(result).to.be.a('string');
208
- (0, chai_1.expect)(result).to.contain('No active debug session to stop');
209
- });
210
- it('should stop specific session by name', async () => {
211
- Object.defineProperty(mockDebugSessionManager, 'sessions', {
212
- value: [
213
- {
214
- id: 'session-1',
215
- configuration: { name: 'Node.js Debug' },
216
- },
217
- {
218
- id: 'session-2',
219
- configuration: { name: 'Python Debug' },
220
- },
221
- ],
222
- writable: true,
223
- configurable: true,
224
- });
225
- const tool = launchStopProvider.getTool();
226
- const result = await tool.handler('{"configurationName":"Node.js Debug"}');
227
- (0, chai_1.expect)(result).to.be.a('string');
228
- (0, chai_1.expect)(result).to.contain('Successfully stopped launch configuration');
229
- (0, chai_1.expect)(result).to.contain('Node.js Debug');
230
- });
231
- it('should handle session not found by name', async () => {
232
- Object.defineProperty(mockDebugSessionManager, 'sessions', {
233
- value: [],
234
- writable: true,
235
- configurable: true,
236
- });
237
- const tool = launchStopProvider.getTool();
238
- const result = await tool.handler('{"configurationName":"Unknown Config"}');
239
- (0, chai_1.expect)(result).to.be.a('string');
240
- (0, chai_1.expect)(result).to.contain('No active session found');
241
- (0, chai_1.expect)(result).to.contain('Unknown Config');
242
- });
243
- });
244
- });
245
- //# sourceMappingURL=workspace-launch-provider.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-launch-provider.spec.js","sourceRoot":"","sources":["../../src/browser/workspace-launch-provider.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,8DAAiE;AACjE,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AACjC,uHAAiH;AACjH,wEAAiC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAE1C,+BAA8B;AAC9B,4DAAyD;AACzD,2EAIqC;AACrC,sGAAiG;AACjG,0FAAqF;AACrF,0FAAqF;AAKrF,YAAY,EAAE,CAAC;AAEf,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC9C,IAAI,SAAoB,CAAC;IACzB,IAAI,kBAAsC,CAAC;IAC3C,IAAI,oBAA0C,CAAC;IAC/C,IAAI,kBAAsC,CAAC;IAC3C,IAAI,6BAAiE,CAAC;IACtE,IAAI,uBAAqD,CAAC;IAE1D,MAAM,CAAC,GAAG,EAAE;QACR,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,GAAG,EAAE;QACP,YAAY,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,GAAG,EAAE;QACZ,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;QAE5B,MAAM,WAAW,GAAG,wBAAwB,EAAE,CAAC;QAE/C,6BAA6B,GAAG;YAC5B,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7B,IAAI,GAAG;gBACH,QAAQ,CAAC,C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G,kBAAkB,CAAC,OAAO,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,uCAAuC,CAC1C,CAAC;YAEF,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CACrB,2CAA2C,CAC9C,CAAC;YACF,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,CAAC,cAAc,CAAC,uBAAuB,EAAE,UAAU,EAAE;gBACvD,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;aACrB,CAAC,CAAC;YAEH,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,wCAAwC,CAC3C,CAAC;YAEF,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;YACrD,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { ToolProvider, ToolRequest } from '@theia/ai-core';
2
- import { PreferenceService } from '@theia/core/lib/common/preferences/preference-service';
3
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
4
- import { SearchInWorkspaceService } from '@theia/search-in-workspace/lib/browser/search-in-workspace-service';
5
- import { WorkspaceFunctionScope } from './workspace-functions';
6
- export declare class WorkspaceSearchProvider implements ToolProvider {
7
- protected readonly searchService: SearchInWorkspaceService;
8
- protected readonly workspaceScope: WorkspaceFunctionScope;
9
- protected readonly preferenceService: PreferenceService;
10
- protected readonly fileService: FileService;
11
- getTool(): ToolRequest;
12
- private determineSearchRoots;
13
- private handleSearch;
14
- }
15
- //# sourceMappingURL=workspace-search-provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-search-provider.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-search-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAA8B,MAAM,oEAAoE,CAAC;AAG1I,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAI/D,qBACa,uBAAwB,YAAW,YAAY;IAGxD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;IAG3D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAE5C,OAAO,IAAI,WAAW;YAwCR,oBAAoB;YAsBpB,YAAY;CA8G7B"}
@@ -1,204 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.WorkspaceSearchProvider = void 0;
19
- const tslib_1 = require("tslib");
20
- const preference_service_1 = require("@theia/core/lib/common/preferences/preference-service");
21
- const inversify_1 = require("@theia/core/shared/inversify");
22
- const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
23
- const search_in_workspace_service_1 = require("@theia/search-in-workspace/lib/browser/search-in-workspace-service");
24
- const workspace_functions_1 = require("../common/workspace-functions");
25
- const workspace_functions_2 = require("./workspace-functions");
26
- const workspace_preferences_1 = require("../common/workspace-preferences");
27
- const workspace_search_provider_util_1 = require("../common/workspace-search-provider-util");
28
- let WorkspaceSearchProvider = class WorkspaceSearchProvider {
29
- getTool() {
30
- return {
31
- id: workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID,
32
- name: workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID,
33
- description: 'Searches the content of files within the workspace for lines matching the given search term (`query`). \
34
- The search uses case-insensitive string matching or regular expressions (controlled by the `useRegExp` parameter). \
35
- It returns a list of matching files, including the file path (URI), the line number, and the full text content of each matching line. \
36
- Multi-word patterns must match exactly (including spaces, case-insensitively). \
37
- For best results, use specific search terms and consider filtering by file extensions or limiting to specific subdirectories to avoid overwhelming results. \
38
- For complex searches, prefer multiple simpler queries over one complex query or regular expression.',
39
- parameters: {
40
- type: 'object',
41
- properties: {
42
- query: {
43
- type: 'string',
44
- description: 'The search term or regular expression pattern.',
45
- },
46
- useRegExp: {
47
- type: 'boolean',
48
- description: 'Set to true if the query is a regular expression.',
49
- },
50
- fileExtensions: {
51
- type: 'array',
52
- items: {
53
- type: 'string'
54
- },
55
- description: 'Optional array of file extensions to search in (e.g., ["ts", "js", "py"]). If not specified, searches all files.'
56
- },
57
- subDirectoryPath: {
58
- type: 'string',
59
- description: 'Optional subdirectory path to limit search scope. Use relative paths from workspace root ' +
60
- '(e.g., "packages/ai-ide/src", "packages/core/src/browser"). If not specified, searches entire workspace.'
61
- }
62
- },
63
- required: ['query', 'useRegExp']
64
- },
65
- handler: (argString, ctx) => { var _a; return this.handleSearch(argString, (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken); }
66
- };
67
- }
68
- async determineSearchRoots(subDirectoryPath) {
69
- const workspaceRoot = await this.workspaceScope.getWorkspaceRoot();
70
- if (!subDirectoryPath) {
71
- return [workspaceRoot.toString()];
72
- }
73
- const subDirUri = workspaceRoot.resolve(subDirectoryPath);
74
- this.workspaceScope.ensureWithinWorkspace(subDirUri, workspaceRoot);
75
- try {
76
- const stat = await this.fileService.resolve(subDirUri);
77
- if (!stat || !stat.isDirectory) {
78
- throw new Error(`Subdirectory '${subDirectoryPath}' does not exist or is not a directory`);
79
- }
80
- }
81
- catch (error) {
82
- throw new Error(`Invalid subdirectory path '${subDirectoryPath}': ${error.message}`);
83
- }
84
- return [subDirUri.toString()];
85
- }
86
- async handleSearch(argString, cancellationToken) {
87
- try {
88
- const args = JSON.parse(argString);
89
- const results = [];
90
- let expectedSearchId;
91
- let searchCompleted = false;
92
- cancellationToken === null || cancellationToken === void 0 ? void 0 : cancellationToken.onCancellationRequested(() => {
93
- if (expectedSearchId !== undefined && !searchCompleted) {
94
- this.searchService.cancel(expectedSearchId);
95
- searchCompleted = true;
96
- }
97
- });
98
- if (cancellationToken === null || cancellationToken === void 0 ? void 0 : cancellationToken.isCancellationRequested) {
99
- return JSON.stringify({ error: 'Operation cancelled by user' });
100
- }
101
- const searchPromise = new Promise(async (resolve, reject) => {
102
- const callbacks = {
103
- onResult: (id, result) => {
104
- if (expectedSearchId !== undefined && id !== expectedSearchId) {
105
- return;
106
- }
107
- if (searchCompleted) {
108
- return;
109
- }
110
- results.push(result);
111
- },
112
- onDone: (id, error) => {
113
- if (expectedSearchId !== undefined && id !== expectedSearchId) {
114
- return;
115
- }
116
- if (searchCompleted) {
117
- return;
118
- }
119
- searchCompleted = true;
120
- if (error) {
121
- reject(new Error('Search failed: ' + error));
122
- }
123
- else {
124
- resolve(results);
125
- }
126
- }
127
- };
128
- // Use one more than our actual maximum. this way we can determine if we have more results than our maximum and warn the user
129
- const maxResultsForTheiaAPI = this.preferenceService.get(workspace_preferences_1.SEARCH_IN_WORKSPACE_MAX_RESULTS_PREF, 30) + 1;
130
- const options = {
131
- useRegExp: args.useRegExp,
132
- matchCase: false,
133
- matchWholeWord: false,
134
- maxResults: maxResultsForTheiaAPI,
135
- };
136
- if (args.fileExtensions && args.fileExtensions.length > 0) {
137
- options.include = args.fileExtensions.map(ext => `**/*.${ext}`);
138
- }
139
- await this.determineSearchRoots(args.subDirectoryPath)
140
- .then(rootUris => this.searchService.searchWithCallback(args.query, rootUris, callbacks, options))
141
- .then(id => {
142
- expectedSearchId = id;
143
- cancellationToken === null || cancellationToken === void 0 ? void 0 : cancellationToken.onCancellationRequested(() => {
144
- this.searchService.cancel(id);
145
- });
146
- })
147
- .catch(err => {
148
- searchCompleted = true;
149
- reject(err);
150
- });
151
- });
152
- const timeoutPromise = new Promise((_, reject) => {
153
- setTimeout(() => {
154
- if (expectedSearchId !== undefined && !searchCompleted) {
155
- this.searchService.cancel(expectedSearchId);
156
- searchCompleted = true;
157
- reject(new Error('Search timed out after 30 seconds'));
158
- }
159
- }, 30000);
160
- });
161
- const finalResults = await Promise.race([searchPromise, timeoutPromise]);
162
- const maxResults = this.preferenceService.get(workspace_preferences_1.SEARCH_IN_WORKSPACE_MAX_RESULTS_PREF, 30);
163
- const workspaceRoot = await this.workspaceScope.getWorkspaceRoot();
164
- const formattedResults = (0, workspace_search_provider_util_1.optimizeSearchResults)(finalResults, workspaceRoot);
165
- let numberOfMatchesInFinalResults = 0;
166
- for (const result of finalResults) {
167
- numberOfMatchesInFinalResults += result.matches.length;
168
- }
169
- if (numberOfMatchesInFinalResults > maxResults) {
170
- return JSON.stringify({
171
- info: 'Search limit exceeded: Found ' + maxResults + '+ results. ' +
172
- 'Please refine your search with more specific terms or use file extension filters. ' +
173
- 'You can increase the limit in preferences under \'ai-features.workspaceFunctions.searchMaxResults\'.',
174
- incompleteResults: formattedResults
175
- });
176
- }
177
- return JSON.stringify(formattedResults);
178
- }
179
- catch (error) {
180
- return JSON.stringify({ error: error.message || 'Failed to execute search' });
181
- }
182
- }
183
- };
184
- exports.WorkspaceSearchProvider = WorkspaceSearchProvider;
185
- tslib_1.__decorate([
186
- (0, inversify_1.inject)(search_in_workspace_service_1.SearchInWorkspaceService),
187
- tslib_1.__metadata("design:type", search_in_workspace_service_1.SearchInWorkspaceService)
188
- ], WorkspaceSearchProvider.prototype, "searchService", void 0);
189
- tslib_1.__decorate([
190
- (0, inversify_1.inject)(workspace_functions_2.WorkspaceFunctionScope),
191
- tslib_1.__metadata("design:type", workspace_functions_2.WorkspaceFunctionScope)
192
- ], WorkspaceSearchProvider.prototype, "workspaceScope", void 0);
193
- tslib_1.__decorate([
194
- (0, inversify_1.inject)(preference_service_1.PreferenceService),
195
- tslib_1.__metadata("design:type", Object)
196
- ], WorkspaceSearchProvider.prototype, "preferenceService", void 0);
197
- tslib_1.__decorate([
198
- (0, inversify_1.inject)(file_service_1.FileService),
199
- tslib_1.__metadata("design:type", file_service_1.FileService)
200
- ], WorkspaceSearchProvider.prototype, "fileService", void 0);
201
- exports.WorkspaceSearchProvider = WorkspaceSearchProvider = tslib_1.__decorate([
202
- (0, inversify_1.injectable)()
203
- ], WorkspaceSearchProvider);
204
- //# sourceMappingURL=workspace-search-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-search-provider.js","sourceRoot":"","sources":["../../src/browser/workspace-search-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yC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4CAAsB;+DAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,sCAAiB,CAAC;;kEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,0BAAW,CAAC;sCACY,0BAAW;4DAAC;kCAZnC,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CA0LnC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=workspace-search-provider.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-search-provider.spec.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-search-provider.spec.ts"],"names":[],"mappings":""}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2025 EclipseSource GmbH.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- const chai_1 = require("chai");
19
- const core_1 = require("@theia/core");
20
- const workspace_search_provider_1 = require("./workspace-search-provider");
21
- const inversify_1 = require("@theia/core/shared/inversify");
22
- const search_in_workspace_service_1 = require("@theia/search-in-workspace/lib/browser/search-in-workspace-service");
23
- const workspace_functions_1 = require("./workspace-functions");
24
- const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
25
- const uri_1 = require("@theia/core/lib/common/uri");
26
- describe('Workspace Search Provider Cancellation Tests', () => {
27
- let cancellationTokenSource;
28
- let mockCtx;
29
- let container;
30
- let searchService;
31
- beforeEach(() => {
32
- cancellationTokenSource = new core_1.CancellationTokenSource();
33
- // Setup mock context
34
- mockCtx = {
35
- response: {
36
- cancellationToken: cancellationTokenSource.token
37
- }
38
- };
39
- // Create a new container for each test
40
- container = new inversify_1.Container();
41
- // Mock dependencies
42
- searchService = {
43
- searchWithCallback: async (query, rootUris, callbacks, options) => {
44
- const searchId = 1;
45
- return searchId;
46
- },
47
- cancel: (searchId) => {
48
- // Mock cancellation
49
- }
50
- };
51
- const mockWorkspaceScope = {
52
- getWorkspaceRoot: async () => new uri_1.URI('file:///workspace'),
53
- ensureWithinWorkspace: () => { },
54
- resolveRelativePath: async (path) => new uri_1.URI(`file:///workspace/${path}`)
55
- };
56
- const mockPreferenceService = {
57
- get: () => 30
58
- };
59
- const mockFileService = {
60
- exists: async () => true,
61
- resolve: async () => ({ isDirectory: true })
62
- };
63
- // Register mocks in the container
64
- container.bind(search_in_workspace_service_1.SearchInWorkspaceService).toConstantValue(searchService);
65
- container.bind(workspace_functions_1.WorkspaceFunctionScope).toConstantValue(mockWorkspaceScope);
66
- container.bind(core_1.PreferenceService).toConstantValue(mockPreferenceService);
67
- container.bind(file_service_1.FileService).toConstantValue(mockFileService);
68
- container.bind(workspace_search_provider_1.WorkspaceSearchProvider).toSelf();
69
- });
70
- afterEach(() => {
71
- cancellationTokenSource.dispose();
72
- });
73
- it('should respect cancellation token at the beginning of the search', async () => {
74
- const searchProvider = container.get(workspace_search_provider_1.WorkspaceSearchProvider);
75
- cancellationTokenSource.cancel();
76
- const handler = searchProvider.getTool().handler;
77
- const result = await handler(JSON.stringify({ query: 'test', useRegExp: false }), mockCtx);
78
- const jsonResponse = JSON.parse(result);
79
- (0, chai_1.expect)(jsonResponse.error).to.equal('Operation cancelled by user');
80
- });
81
- });
82
- //# sourceMappingURL=workspace-search-provider.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-search-provider.spec.js","sourceRoot":"","sources":["../../src/browser/workspace-search-provider.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE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ClD,IAAA,aAAM,EAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { ToolProvider, ToolRequest } from '@theia/ai-core';
2
- import { TaskService } from '@theia/task/lib/browser/task-service';
3
- import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
4
- export declare class TaskListProvider implements ToolProvider {
5
- protected readonly taskService: TaskService;
6
- getTool(): ToolRequest;
7
- private getAvailableTasks;
8
- }
9
- export declare class TaskRunnerProvider implements ToolProvider {
10
- protected readonly taskService: TaskService;
11
- protected readonly terminalService: TerminalService;
12
- getTool(): ToolRequest;
13
- private handleRunTask;
14
- }
15
- //# sourceMappingURL=workspace-task-provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-task-provider.d.ts","sourceRoot":"","sources":["../../src/browser/workspace-task-provider.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AAKpF,qBACa,gBAAiB,YAAW,YAAY;IAGjD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAE5C,OAAO,IAAI,WAAW;YA0BR,iBAAiB;CAMlC;AAED,qBACa,kBAAmB,YAAW,YAAY;IAGnD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAG5C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAEpD,OAAO,IAAI,WAAW;YAoBR,aAAa;CA0C9B"}