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

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 (373) hide show
  1. package/lib/browser/address-pr-review-command-contribution.d.ts +9 -0
  2. package/lib/browser/address-pr-review-command-contribution.d.ts.map +1 -0
  3. package/lib/browser/address-pr-review-command-contribution.js +176 -0
  4. package/lib/browser/address-pr-review-command-contribution.js.map +1 -0
  5. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +47 -0
  6. package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -0
  7. package/lib/browser/ai-configuration/agent-configuration-widget.js +385 -0
  8. package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -0
  9. package/lib/browser/ai-configuration/ai-configuration-service.d.ts +18 -0
  10. package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +1 -0
  11. package/lib/browser/ai-configuration/ai-configuration-service.js +53 -0
  12. package/lib/browser/ai-configuration/ai-configuration-service.js.map +1 -0
  13. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +14 -0
  14. package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +1 -0
  15. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +67 -0
  16. package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -0
  17. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +29 -0
  18. package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +1 -0
  19. package/lib/browser/ai-configuration/ai-configuration-widget.js +118 -0
  20. package/lib/browser/ai-configuration/ai-configuration-widget.js.map +1 -0
  21. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts +32 -0
  22. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts.map +1 -0
  23. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js +55 -0
  24. package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js.map +1 -0
  25. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts +14 -0
  26. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts.map +1 -0
  27. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js +35 -0
  28. package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js.map +1 -0
  29. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts +23 -0
  30. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts.map +1 -0
  31. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js +60 -0
  32. package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js.map +1 -0
  33. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts +56 -0
  34. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts.map +1 -0
  35. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js +96 -0
  36. package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js.map +1 -0
  37. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts +45 -0
  38. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts.map +1 -0
  39. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js +66 -0
  40. package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js.map +1 -0
  41. package/lib/browser/ai-configuration/components/configuration-section.d.ts +13 -0
  42. package/lib/browser/ai-configuration/components/configuration-section.d.ts.map +1 -0
  43. package/lib/browser/ai-configuration/components/configuration-section.js +28 -0
  44. package/lib/browser/ai-configuration/components/configuration-section.js.map +1 -0
  45. package/lib/browser/ai-configuration/components/empty-state.d.ts +11 -0
  46. package/lib/browser/ai-configuration/components/empty-state.d.ts.map +1 -0
  47. package/lib/browser/ai-configuration/components/empty-state.js +26 -0
  48. package/lib/browser/ai-configuration/components/empty-state.js.map +1 -0
  49. package/lib/browser/ai-configuration/components/expandable-section.d.ts +14 -0
  50. package/lib/browser/ai-configuration/components/expandable-section.d.ts.map +1 -0
  51. package/lib/browser/ai-configuration/components/expandable-section.js +31 -0
  52. package/lib/browser/ai-configuration/components/expandable-section.js.map +1 -0
  53. package/lib/browser/ai-configuration/language-model-renderer.d.ts +13 -0
  54. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -0
  55. package/lib/browser/ai-configuration/language-model-renderer.js +105 -0
  56. package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -0
  57. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +42 -0
  58. package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +1 -0
  59. package/lib/browser/ai-configuration/mcp-configuration-widget.js +308 -0
  60. package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +1 -0
  61. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +27 -0
  62. package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +1 -0
  63. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +197 -0
  64. package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +1 -0
  65. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +141 -0
  66. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -0
  67. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +508 -0
  68. package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -0
  69. package/lib/browser/ai-configuration/template-settings-renderer.d.ts +10 -0
  70. package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -0
  71. package/lib/browser/ai-configuration/template-settings-renderer.js +48 -0
  72. package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -0
  73. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +21 -0
  74. package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +1 -0
  75. package/lib/browser/ai-configuration/token-usage-configuration-widget.js +170 -0
  76. package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +1 -0
  77. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +35 -0
  78. package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -0
  79. package/lib/browser/ai-configuration/tools-configuration-widget.js +158 -0
  80. package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -0
  81. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +23 -0
  82. package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +1 -0
  83. package/lib/browser/ai-configuration/variable-configuration-widget.js +132 -0
  84. package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -0
  85. package/lib/browser/ai-ide-activation-service.d.ts +18 -0
  86. package/lib/browser/ai-ide-activation-service.d.ts.map +1 -0
  87. package/lib/browser/ai-ide-activation-service.js +71 -0
  88. package/lib/browser/ai-ide-activation-service.js.map +1 -0
  89. package/lib/browser/ai-terminal-functions.d.ts +13 -0
  90. package/lib/browser/ai-terminal-functions.d.ts.map +1 -0
  91. package/lib/browser/ai-terminal-functions.js +114 -0
  92. package/lib/browser/ai-terminal-functions.js.map +1 -0
  93. package/lib/browser/analyze-gh-ticket-command-contribution.d.ts +9 -0
  94. package/lib/browser/analyze-gh-ticket-command-contribution.d.ts.map +1 -0
  95. package/lib/browser/analyze-gh-ticket-command-contribution.js +172 -0
  96. package/lib/browser/analyze-gh-ticket-command-contribution.js.map +1 -0
  97. package/lib/browser/app-tester-chat-agent.d.ts +35 -0
  98. package/lib/browser/app-tester-chat-agent.d.ts.map +1 -0
  99. package/lib/browser/app-tester-chat-agent.js +142 -0
  100. package/lib/browser/app-tester-chat-agent.js.map +1 -0
  101. package/lib/browser/app-tester-chat-functions.d.ts +25 -0
  102. package/lib/browser/app-tester-chat-functions.d.ts.map +1 -0
  103. package/lib/browser/app-tester-chat-functions.js +170 -0
  104. package/lib/browser/app-tester-chat-functions.js.map +1 -0
  105. package/lib/browser/app-tester-prompt-template.d.ts +6 -0
  106. package/lib/browser/app-tester-prompt-template.d.ts.map +1 -0
  107. package/lib/browser/app-tester-prompt-template.js +83 -0
  108. package/lib/browser/app-tester-prompt-template.js.map +1 -0
  109. package/lib/browser/architect-agent.d.ts +15 -0
  110. package/lib/browser/architect-agent.d.ts.map +1 -0
  111. package/lib/browser/architect-agent.js +68 -0
  112. package/lib/browser/architect-agent.js.map +1 -0
  113. package/lib/browser/coder-agent.d.ts +15 -0
  114. package/lib/browser/coder-agent.d.ts.map +1 -0
  115. package/lib/browser/coder-agent.js +81 -0
  116. package/lib/browser/coder-agent.js.map +1 -0
  117. package/lib/browser/context-file-validation-service-impl.d.ts +13 -0
  118. package/lib/browser/context-file-validation-service-impl.d.ts.map +1 -0
  119. package/lib/browser/context-file-validation-service-impl.js +123 -0
  120. package/lib/browser/context-file-validation-service-impl.js.map +1 -0
  121. package/lib/browser/context-file-validation-service-impl.spec.d.ts +2 -0
  122. package/lib/browser/context-file-validation-service-impl.spec.d.ts.map +1 -0
  123. package/lib/browser/context-file-validation-service-impl.spec.js +340 -0
  124. package/lib/browser/context-file-validation-service-impl.spec.js.map +1 -0
  125. package/lib/browser/context-functions.d.ts +16 -0
  126. package/lib/browser/context-functions.d.ts.map +1 -0
  127. package/lib/browser/context-functions.js +166 -0
  128. package/lib/browser/context-functions.js.map +1 -0
  129. package/lib/browser/context-functions.spec.d.ts +2 -0
  130. package/lib/browser/context-functions.spec.d.ts.map +1 -0
  131. package/lib/browser/context-functions.spec.js +213 -0
  132. package/lib/browser/context-functions.spec.js.map +1 -0
  133. package/lib/browser/file-changeset-function.spec.d.ts +2 -0
  134. package/lib/browser/file-changeset-function.spec.d.ts.map +1 -0
  135. package/lib/browser/file-changeset-function.spec.js +45 -0
  136. package/lib/browser/file-changeset-function.spec.js.map +1 -0
  137. package/lib/browser/file-changeset-functions.d.ts +87 -0
  138. package/lib/browser/file-changeset-functions.d.ts.map +1 -0
  139. package/lib/browser/file-changeset-functions.js +645 -0
  140. package/lib/browser/file-changeset-functions.js.map +1 -0
  141. package/lib/browser/file-changeset-functions.spec.d.ts +2 -0
  142. package/lib/browser/file-changeset-functions.spec.d.ts.map +1 -0
  143. package/lib/browser/file-changeset-functions.spec.js +179 -0
  144. package/lib/browser/file-changeset-functions.spec.js.map +1 -0
  145. package/lib/browser/frontend-module.d.ts +5 -0
  146. package/lib/browser/frontend-module.d.ts.map +1 -0
  147. package/lib/browser/frontend-module.js +226 -0
  148. package/lib/browser/frontend-module.js.map +1 -0
  149. package/lib/browser/github-chat-agent.d.ts +48 -0
  150. package/lib/browser/github-chat-agent.d.ts.map +1 -0
  151. package/lib/browser/github-chat-agent.js +222 -0
  152. package/lib/browser/github-chat-agent.js.map +1 -0
  153. package/lib/browser/github-prompt-template.d.ts +6 -0
  154. package/lib/browser/github-prompt-template.d.ts.map +1 -0
  155. package/lib/browser/github-prompt-template.js +53 -0
  156. package/lib/browser/github-prompt-template.js.map +1 -0
  157. package/lib/browser/github-repo-variable-contribution.d.ts +15 -0
  158. package/lib/browser/github-repo-variable-contribution.d.ts.map +1 -0
  159. package/lib/browser/github-repo-variable-contribution.js +82 -0
  160. package/lib/browser/github-repo-variable-contribution.js.map +1 -0
  161. package/lib/browser/ide-chat-welcome-message-provider.d.ts +10 -0
  162. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -0
  163. package/lib/browser/ide-chat-welcome-message-provider.js +102 -0
  164. package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -0
  165. package/lib/browser/implement-gh-ticket-command-contribution.d.ts +9 -0
  166. package/lib/browser/implement-gh-ticket-command-contribution.d.ts.map +1 -0
  167. package/lib/browser/implement-gh-ticket-command-contribution.js +156 -0
  168. package/lib/browser/implement-gh-ticket-command-contribution.js.map +1 -0
  169. package/lib/browser/project-info-agent.d.ts +13 -0
  170. package/lib/browser/project-info-agent.d.ts.map +1 -0
  171. package/lib/browser/project-info-agent.js +45 -0
  172. package/lib/browser/project-info-agent.js.map +1 -0
  173. package/lib/browser/remember-command-contribution.d.ts +16 -0
  174. package/lib/browser/remember-command-contribution.d.ts.map +1 -0
  175. package/lib/browser/remember-command-contribution.js +101 -0
  176. package/lib/browser/remember-command-contribution.js.map +1 -0
  177. package/lib/browser/summarize-session-command-contribution.d.ts +19 -0
  178. package/lib/browser/summarize-session-command-contribution.d.ts.map +1 -0
  179. package/lib/browser/summarize-session-command-contribution.js +118 -0
  180. package/lib/browser/summarize-session-command-contribution.js.map +1 -0
  181. package/lib/browser/task-background-summary-variable.d.ts +9 -0
  182. package/lib/browser/task-background-summary-variable.d.ts.map +1 -0
  183. package/lib/browser/task-background-summary-variable.js +60 -0
  184. package/lib/browser/task-background-summary-variable.js.map +1 -0
  185. package/lib/browser/task-context-agent.d.ts +13 -0
  186. package/lib/browser/task-context-agent.d.ts.map +1 -0
  187. package/lib/browser/task-context-agent.js +45 -0
  188. package/lib/browser/task-context-agent.js.map +1 -0
  189. package/lib/browser/task-context-file-storage-service.d.ts +40 -0
  190. package/lib/browser/task-context-file-storage-service.d.ts.map +1 -0
  191. package/lib/browser/task-context-file-storage-service.js +232 -0
  192. package/lib/browser/task-context-file-storage-service.js.map +1 -0
  193. package/lib/browser/template-preference-contribution.d.ts +17 -0
  194. package/lib/browser/template-preference-contribution.d.ts.map +1 -0
  195. package/lib/browser/template-preference-contribution.js +94 -0
  196. package/lib/browser/template-preference-contribution.js.map +1 -0
  197. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +2 -0
  198. package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +1 -0
  199. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +52 -0
  200. package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +1 -0
  201. package/lib/browser/workspace-functions.d.ts +78 -0
  202. package/lib/browser/workspace-functions.d.ts.map +1 -0
  203. package/lib/browser/workspace-functions.js +697 -0
  204. package/lib/browser/workspace-functions.js.map +1 -0
  205. package/lib/browser/workspace-functions.spec.d.ts +2 -0
  206. package/lib/browser/workspace-functions.spec.d.ts.map +1 -0
  207. package/lib/browser/workspace-functions.spec.js +161 -0
  208. package/lib/browser/workspace-functions.spec.js.map +1 -0
  209. package/lib/browser/workspace-launch-provider.d.ts +24 -0
  210. package/lib/browser/workspace-launch-provider.d.ts.map +1 -0
  211. package/lib/browser/workspace-launch-provider.js +216 -0
  212. package/lib/browser/workspace-launch-provider.js.map +1 -0
  213. package/lib/browser/workspace-launch-provider.spec.d.ts +2 -0
  214. package/lib/browser/workspace-launch-provider.spec.d.ts.map +1 -0
  215. package/lib/browser/workspace-launch-provider.spec.js +245 -0
  216. package/lib/browser/workspace-launch-provider.spec.js.map +1 -0
  217. package/lib/browser/workspace-search-provider.d.ts +15 -0
  218. package/lib/browser/workspace-search-provider.d.ts.map +1 -0
  219. package/lib/browser/workspace-search-provider.js +204 -0
  220. package/lib/browser/workspace-search-provider.js.map +1 -0
  221. package/lib/browser/workspace-search-provider.spec.d.ts +2 -0
  222. package/lib/browser/workspace-search-provider.spec.d.ts.map +1 -0
  223. package/lib/browser/workspace-search-provider.spec.js +82 -0
  224. package/lib/browser/workspace-search-provider.spec.js.map +1 -0
  225. package/lib/browser/workspace-task-provider.d.ts +15 -0
  226. package/lib/browser/workspace-task-provider.d.ts.map +1 -0
  227. package/lib/browser/workspace-task-provider.js +138 -0
  228. package/lib/browser/workspace-task-provider.js.map +1 -0
  229. package/lib/browser/workspace-task-provider.spec.d.ts +2 -0
  230. package/lib/browser/workspace-task-provider.spec.d.ts.map +1 -0
  231. package/lib/browser/workspace-task-provider.spec.js +109 -0
  232. package/lib/browser/workspace-task-provider.spec.js.map +1 -0
  233. package/lib/common/ai-configuration-preferences.d.ts +8 -0
  234. package/lib/common/ai-configuration-preferences.d.ts.map +1 -0
  235. package/lib/common/ai-configuration-preferences.js +41 -0
  236. package/lib/common/ai-configuration-preferences.js.map +1 -0
  237. package/lib/common/ai-ide-preferences.d.ts +5 -0
  238. package/lib/common/ai-ide-preferences.d.ts.map +1 -0
  239. package/lib/common/ai-ide-preferences.js +53 -0
  240. package/lib/common/ai-ide-preferences.js.map +1 -0
  241. package/lib/common/ai-terminal-functions.d.ts +2 -0
  242. package/lib/common/ai-terminal-functions.d.ts.map +1 -0
  243. package/lib/common/ai-terminal-functions.js +20 -0
  244. package/lib/common/ai-terminal-functions.js.map +1 -0
  245. package/lib/common/app-tester-chat-functions.d.ts +5 -0
  246. package/lib/common/app-tester-chat-functions.d.ts.map +1 -0
  247. package/lib/common/app-tester-chat-functions.js +23 -0
  248. package/lib/common/app-tester-chat-functions.js.map +1 -0
  249. package/lib/common/architect-prompt-template.d.ts +3 -0
  250. package/lib/common/architect-prompt-template.d.ts.map +1 -0
  251. package/lib/common/architect-prompt-template.js +81 -0
  252. package/lib/common/architect-prompt-template.js.map +1 -0
  253. package/lib/common/browser-automation-protocol.d.ts +15 -0
  254. package/lib/common/browser-automation-protocol.d.ts.map +1 -0
  255. package/lib/common/browser-automation-protocol.js +22 -0
  256. package/lib/common/browser-automation-protocol.js.map +1 -0
  257. package/lib/common/coder-replace-prompt-template.d.ts +11 -0
  258. package/lib/common/coder-replace-prompt-template.d.ts.map +1 -0
  259. package/lib/common/coder-replace-prompt-template.js +296 -0
  260. package/lib/common/coder-replace-prompt-template.js.map +1 -0
  261. package/lib/common/command-chat-agents.d.ts +36 -0
  262. package/lib/common/command-chat-agents.d.ts.map +1 -0
  263. package/lib/common/command-chat-agents.js +122 -0
  264. package/lib/common/command-chat-agents.js.map +1 -0
  265. package/lib/common/command-prompt-template.d.ts +3 -0
  266. package/lib/common/command-prompt-template.d.ts.map +1 -0
  267. package/lib/common/command-prompt-template.js +226 -0
  268. package/lib/common/command-prompt-template.js.map +1 -0
  269. package/lib/common/context-files-variable.d.ts +9 -0
  270. package/lib/common/context-files-variable.d.ts.map +1 -0
  271. package/lib/common/context-files-variable.js +52 -0
  272. package/lib/common/context-files-variable.js.map +1 -0
  273. package/lib/common/context-functions.d.ts +4 -0
  274. package/lib/common/context-functions.d.ts.map +1 -0
  275. package/lib/common/context-functions.js +22 -0
  276. package/lib/common/context-functions.js.map +1 -0
  277. package/lib/common/context-variables.d.ts +3 -0
  278. package/lib/common/context-variables.d.ts.map +1 -0
  279. package/lib/common/context-variables.js +21 -0
  280. package/lib/common/context-variables.js.map +1 -0
  281. package/lib/common/file-changeset-function-ids.d.ts +19 -0
  282. package/lib/common/file-changeset-function-ids.d.ts.map +1 -0
  283. package/lib/common/file-changeset-function-ids.js +37 -0
  284. package/lib/common/file-changeset-function-ids.js.map +1 -0
  285. package/lib/common/github-repo-protocol.d.ts +15 -0
  286. package/lib/common/github-repo-protocol.d.ts.map +1 -0
  287. package/lib/common/github-repo-protocol.js +21 -0
  288. package/lib/common/github-repo-protocol.js.map +1 -0
  289. package/lib/common/orchestrator-chat-agent.d.ts +36 -0
  290. package/lib/common/orchestrator-chat-agent.d.ts.map +1 -0
  291. package/lib/common/orchestrator-chat-agent.js +167 -0
  292. package/lib/common/orchestrator-chat-agent.js.map +1 -0
  293. package/lib/common/orchestrator-prompt-template.d.ts +3 -0
  294. package/lib/common/orchestrator-prompt-template.d.ts.map +1 -0
  295. package/lib/common/orchestrator-prompt-template.js +55 -0
  296. package/lib/common/orchestrator-prompt-template.js.map +1 -0
  297. package/lib/common/project-info-prompt-template.d.ts +6 -0
  298. package/lib/common/project-info-prompt-template.d.ts.map +1 -0
  299. package/lib/common/project-info-prompt-template.js +145 -0
  300. package/lib/common/project-info-prompt-template.js.map +1 -0
  301. package/lib/common/summarize-session-commands.d.ts +4 -0
  302. package/lib/common/summarize-session-commands.d.ts.map +1 -0
  303. package/lib/common/summarize-session-commands.js +28 -0
  304. package/lib/common/summarize-session-commands.js.map +1 -0
  305. package/lib/common/task-context-prompt-template.d.ts +8 -0
  306. package/lib/common/task-context-prompt-template.d.ts.map +1 -0
  307. package/lib/common/task-context-prompt-template.js +217 -0
  308. package/lib/common/task-context-prompt-template.js.map +1 -0
  309. package/lib/common/universal-chat-agent.d.ts +17 -0
  310. package/lib/common/universal-chat-agent.d.ts.map +1 -0
  311. package/lib/common/universal-chat-agent.js +47 -0
  312. package/lib/common/universal-chat-agent.js.map +1 -0
  313. package/lib/common/universal-prompt-template.d.ts +4 -0
  314. package/lib/common/universal-prompt-template.d.ts.map +1 -0
  315. package/lib/common/universal-prompt-template.js +32 -0
  316. package/lib/common/universal-prompt-template.js.map +1 -0
  317. package/lib/common/workspace-functions.d.ts +12 -0
  318. package/lib/common/workspace-functions.d.ts.map +1 -0
  319. package/lib/common/workspace-functions.js +30 -0
  320. package/lib/common/workspace-functions.js.map +1 -0
  321. package/lib/common/workspace-preferences.d.ts +10 -0
  322. package/lib/common/workspace-preferences.d.ts.map +1 -0
  323. package/lib/common/workspace-preferences.js +89 -0
  324. package/lib/common/workspace-preferences.js.map +1 -0
  325. package/lib/common/workspace-search-provider-util.d.ts +17 -0
  326. package/lib/common/workspace-search-provider-util.d.ts.map +1 -0
  327. package/lib/common/workspace-search-provider-util.js +51 -0
  328. package/lib/common/workspace-search-provider-util.js.map +1 -0
  329. package/lib/node/app-tester-agent/browser-automation-impl.d.ts +18 -0
  330. package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +1 -0
  331. package/lib/node/app-tester-agent/browser-automation-impl.js +96 -0
  332. package/lib/node/app-tester-agent/browser-automation-impl.js.map +1 -0
  333. package/lib/node/backend-module.d.ts +4 -0
  334. package/lib/node/backend-module.d.ts.map +1 -0
  335. package/lib/node/backend-module.js +45 -0
  336. package/lib/node/backend-module.js.map +1 -0
  337. package/lib/node/github-repo-service-impl.d.ts +7 -0
  338. package/lib/node/github-repo-service-impl.d.ts.map +1 -0
  339. package/lib/node/github-repo-service-impl.js +86 -0
  340. package/lib/node/github-repo-service-impl.js.map +1 -0
  341. package/lib/package.spec.d.ts +1 -0
  342. package/lib/package.spec.d.ts.map +1 -0
  343. package/lib/package.spec.js +26 -0
  344. package/lib/package.spec.js.map +1 -0
  345. package/package.json +21 -21
  346. package/src/browser/address-pr-review-command-contribution.ts +180 -0
  347. package/src/browser/ai-configuration/agent-configuration-widget.tsx +256 -135
  348. package/src/browser/ai-configuration/base/ai-card-grid-configuration-widget.tsx +72 -0
  349. package/src/browser/ai-configuration/base/ai-configuration-base-widget.tsx +37 -0
  350. package/src/browser/ai-configuration/base/ai-hierarchical-configuration-widget.tsx +51 -0
  351. package/src/browser/ai-configuration/base/ai-list-detail-configuration-widget.tsx +140 -0
  352. package/src/browser/ai-configuration/base/ai-table-configuration-widget.tsx +107 -0
  353. package/src/browser/ai-configuration/components/configuration-section.tsx +37 -0
  354. package/src/browser/ai-configuration/components/empty-state.tsx +30 -0
  355. package/src/browser/ai-configuration/components/expandable-section.tsx +51 -0
  356. package/src/browser/ai-configuration/language-model-renderer.tsx +68 -63
  357. package/src/browser/ai-configuration/mcp-configuration-widget.tsx +80 -85
  358. package/src/browser/ai-configuration/model-aliases-configuration-widget.tsx +93 -107
  359. package/src/browser/ai-configuration/template-settings-renderer.tsx +25 -29
  360. package/src/browser/ai-configuration/token-usage-configuration-widget.tsx +130 -130
  361. package/src/browser/ai-configuration/tools-configuration-widget.tsx +68 -59
  362. package/src/browser/ai-configuration/variable-configuration-widget.tsx +95 -45
  363. package/src/browser/analyze-gh-ticket-command-contribution.ts +176 -0
  364. package/src/browser/frontend-module.ts +6 -0
  365. package/src/browser/implement-gh-ticket-command-contribution.ts +160 -0
  366. package/src/browser/style/ai-configuration-base.css +90 -0
  367. package/src/browser/style/ai-configuration-cards.css +60 -0
  368. package/src/browser/style/ai-configuration-hierarchical.css +61 -0
  369. package/src/browser/style/ai-configuration-list-detail.css +88 -0
  370. package/src/browser/style/ai-configuration-table.css +73 -0
  371. package/src/browser/style/index.css +458 -288
  372. package/src/browser/style/widgets/mcp-configuration.css +253 -0
  373. package/src/browser/style/widgets/model-aliases-configuration.css +74 -0
@@ -0,0 +1,645 @@
1
+ "use strict";
2
+ var SuggestFileContent_1, WriteFileContent_1, SimpleSuggestFileReplacements_1, SimpleWriteFileReplacements_1, SuggestFileReplacements_Simple_1, WriteFileReplacements_1, ClearFileChanges_1, SuggestFileReplacements_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.DefaultFileChangeSetTitleProvider = exports.SuggestFileReplacements = exports.ReplaceContentInFileFunctionHelperV2 = exports.GetProposedFileState = exports.ClearFileChanges = exports.WriteFileReplacements = exports.SuggestFileReplacements_Simple = exports.SimpleWriteFileReplacements = exports.SimpleSuggestFileReplacements = exports.ReplaceContentInFileFunctionHelper = exports.WriteFileContent = exports.SuggestFileContent = exports.FileChangeSetTitleProvider = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const change_set_file_element_1 = require("@theia/ai-chat/lib/browser/change-set-file-element");
7
+ const content_replacer_1 = require("@theia/core/lib/common/content-replacer");
8
+ const content_replacer_v2_impl_1 = require("@theia/core/lib/common/content-replacer-v2-impl");
9
+ const inversify_1 = require("@theia/core/shared/inversify");
10
+ const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
11
+ const workspace_functions_1 = require("./workspace-functions");
12
+ const core_1 = require("@theia/core");
13
+ const file_changeset_function_ids_1 = require("../common/file-changeset-function-ids");
14
+ exports.FileChangeSetTitleProvider = Symbol('FileChangeSetTitleProvider');
15
+ let SuggestFileContent = SuggestFileContent_1 = class SuggestFileContent {
16
+ getTool() {
17
+ return {
18
+ id: SuggestFileContent_1.ID,
19
+ name: SuggestFileContent_1.ID,
20
+ description: `Proposes writing content to a file. If the file exists, it will be overwritten with the provided content.\n
21
+ If the file does not exist, it will be created. This tool will automatically create any directories needed to write the file.\n
22
+ If the new content is empty, the file will be deleted. To move a file, delete it and re-create it at the new location.\n
23
+ The proposed changes will be applied when the user accepts. If called again for the same file, previously proposed changes will be overridden.`,
24
+ parameters: {
25
+ type: 'object',
26
+ properties: {
27
+ path: {
28
+ type: 'string',
29
+ description: 'The path of the file to write to.'
30
+ },
31
+ content: {
32
+ type: 'string',
33
+ description: `The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions.\n
34
+ You MUST include ALL parts of the file, even if they haven\'t been modified.`
35
+ }
36
+ },
37
+ required: ['path', 'content']
38
+ },
39
+ handler: async (args, ctx) => {
40
+ var _a, _b;
41
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
42
+ return JSON.stringify({ error: 'Operation cancelled by user' });
43
+ }
44
+ const { path, content } = JSON.parse(args);
45
+ const chatSessionId = ctx.session.id;
46
+ const uri = await this.workspaceFunctionScope.resolveRelativePath(path);
47
+ let type = 'modify';
48
+ if (content === '') {
49
+ type = 'delete';
50
+ }
51
+ if (!(await this.fileService.exists(uri))) {
52
+ type = 'add';
53
+ }
54
+ ctx.session.changeSet.addElements(this.fileChangeFactory({
55
+ uri: uri,
56
+ type,
57
+ state: 'pending',
58
+ targetState: content,
59
+ requestId: ctx.id,
60
+ chatSessionId
61
+ }));
62
+ ctx.session.changeSet.setTitle(this.fileChangeSetTitleProvider.getChangeSetTitle(ctx));
63
+ return `Proposed writing to file ${path}. The user will review and potentially apply the changes`;
64
+ }
65
+ };
66
+ }
67
+ };
68
+ exports.SuggestFileContent = SuggestFileContent;
69
+ SuggestFileContent.ID = file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID;
70
+ tslib_1.__decorate([
71
+ (0, inversify_1.inject)(workspace_functions_1.WorkspaceFunctionScope),
72
+ tslib_1.__metadata("design:type", workspace_functions_1.WorkspaceFunctionScope)
73
+ ], SuggestFileContent.prototype, "workspaceFunctionScope", void 0);
74
+ tslib_1.__decorate([
75
+ (0, inversify_1.inject)(file_service_1.FileService),
76
+ tslib_1.__metadata("design:type", file_service_1.FileService)
77
+ ], SuggestFileContent.prototype, "fileService", void 0);
78
+ tslib_1.__decorate([
79
+ (0, inversify_1.inject)(change_set_file_element_1.ChangeSetFileElementFactory),
80
+ tslib_1.__metadata("design:type", Function)
81
+ ], SuggestFileContent.prototype, "fileChangeFactory", void 0);
82
+ tslib_1.__decorate([
83
+ (0, inversify_1.inject)(exports.FileChangeSetTitleProvider),
84
+ tslib_1.__metadata("design:type", Object)
85
+ ], SuggestFileContent.prototype, "fileChangeSetTitleProvider", void 0);
86
+ exports.SuggestFileContent = SuggestFileContent = SuggestFileContent_1 = tslib_1.__decorate([
87
+ (0, inversify_1.injectable)()
88
+ ], SuggestFileContent);
89
+ let WriteFileContent = WriteFileContent_1 = class WriteFileContent {
90
+ getTool() {
91
+ return {
92
+ id: WriteFileContent_1.ID,
93
+ name: WriteFileContent_1.ID,
94
+ description: `Immediately writes content to a file. If the file exists, it will be overwritten with the provided content.\n
95
+ If the file does not exist, it will be created. This tool will automatically create any directories needed to write the file.\n
96
+ If the new content is empty, the file will be deleted. To move a file, delete it and re-create it at the new location.\n
97
+ Unlike suggestFileContent, this function applies the changes immediately without user confirmation.`,
98
+ parameters: {
99
+ type: 'object',
100
+ properties: {
101
+ path: {
102
+ type: 'string',
103
+ description: 'The path of the file to write to.'
104
+ },
105
+ content: {
106
+ type: 'string',
107
+ description: `The content to write to the file. ALWAYS provide the COMPLETE intended content of the file, without any truncation or omissions.\n
108
+ You MUST include ALL parts of the file, even if they haven\'t been modified.`
109
+ }
110
+ },
111
+ required: ['path', 'content']
112
+ },
113
+ handler: async (args, ctx) => {
114
+ var _a, _b;
115
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
116
+ return JSON.stringify({ error: 'Operation cancelled by user' });
117
+ }
118
+ const { path, content } = JSON.parse(args);
119
+ const chatSessionId = ctx.session.id;
120
+ const uri = await this.workspaceFunctionScope.resolveRelativePath(path);
121
+ let type = 'modify';
122
+ if (content === '') {
123
+ type = 'delete';
124
+ }
125
+ if (!(await this.fileService.exists(uri))) {
126
+ type = 'add';
127
+ }
128
+ // Create the file change element
129
+ const fileElement = this.fileChangeFactory({
130
+ uri: uri,
131
+ type: type,
132
+ state: 'pending',
133
+ targetState: content,
134
+ requestId: ctx.id,
135
+ chatSessionId
136
+ });
137
+ ctx.session.changeSet.setTitle(this.fileChangeSetTitleProvider.getChangeSetTitle(ctx));
138
+ // Add the element to the change set
139
+ ctx.session.changeSet.addElements(fileElement);
140
+ try {
141
+ // Immediately apply the change
142
+ await fileElement.apply();
143
+ return `Successfully wrote content to file ${path}.`;
144
+ }
145
+ catch (error) {
146
+ return `Failed to write content to file ${path}: ${error.message}`;
147
+ }
148
+ }
149
+ };
150
+ }
151
+ };
152
+ exports.WriteFileContent = WriteFileContent;
153
+ WriteFileContent.ID = file_changeset_function_ids_1.WRITE_FILE_CONTENT_ID;
154
+ tslib_1.__decorate([
155
+ (0, inversify_1.inject)(workspace_functions_1.WorkspaceFunctionScope),
156
+ tslib_1.__metadata("design:type", workspace_functions_1.WorkspaceFunctionScope)
157
+ ], WriteFileContent.prototype, "workspaceFunctionScope", void 0);
158
+ tslib_1.__decorate([
159
+ (0, inversify_1.inject)(file_service_1.FileService),
160
+ tslib_1.__metadata("design:type", file_service_1.FileService)
161
+ ], WriteFileContent.prototype, "fileService", void 0);
162
+ tslib_1.__decorate([
163
+ (0, inversify_1.inject)(change_set_file_element_1.ChangeSetFileElementFactory),
164
+ tslib_1.__metadata("design:type", Function)
165
+ ], WriteFileContent.prototype, "fileChangeFactory", void 0);
166
+ tslib_1.__decorate([
167
+ (0, inversify_1.inject)(exports.FileChangeSetTitleProvider),
168
+ tslib_1.__metadata("design:type", Object)
169
+ ], WriteFileContent.prototype, "fileChangeSetTitleProvider", void 0);
170
+ exports.WriteFileContent = WriteFileContent = WriteFileContent_1 = tslib_1.__decorate([
171
+ (0, inversify_1.injectable)()
172
+ ], WriteFileContent);
173
+ let ReplaceContentInFileFunctionHelper = class ReplaceContentInFileFunctionHelper {
174
+ constructor() {
175
+ this.replacer = new content_replacer_1.ContentReplacerV1Impl();
176
+ }
177
+ setReplacer(replacer) {
178
+ this.replacer = replacer;
179
+ }
180
+ getToolMetadata(supportMultipleReplace = false, immediateApplication = false) {
181
+ const replacementProperties = {
182
+ oldContent: {
183
+ type: 'string',
184
+ description: 'The exact content to be replaced. Must match exactly, including whitespace, comments, etc.'
185
+ },
186
+ newContent: {
187
+ type: 'string',
188
+ description: 'The new content to insert in place of matched old content.'
189
+ }
190
+ };
191
+ if (supportMultipleReplace) {
192
+ replacementProperties.multiple = {
193
+ type: 'boolean',
194
+ description: 'Set to true if multiple occurrences of the oldContent are expected to be replaced.'
195
+ };
196
+ }
197
+ const replacementParameters = {
198
+ type: 'object',
199
+ properties: {
200
+ path: {
201
+ type: 'string',
202
+ description: 'The path of the file where content will be replaced.'
203
+ },
204
+ replacements: {
205
+ type: 'array',
206
+ items: {
207
+ type: 'object',
208
+ properties: replacementProperties,
209
+ required: ['oldContent', 'newContent']
210
+ },
211
+ description: `An array of replacement objects, each containing oldContent and newContent strings.
212
+ Ensure these strings are valid JSON string values, escaping quotes only as required.`
213
+ },
214
+ reset: {
215
+ type: 'boolean',
216
+ description: 'Set to true to clear any existing pending changes for this file and start fresh. Default is false, which merges with existing changes.'
217
+ }
218
+ },
219
+ required: ['path', 'replacements']
220
+ };
221
+ const replacementSentence = supportMultipleReplace
222
+ ? 'By default, a single occurrence of each old content in the tuples is expected to be replaced. If the optional \'multiple\' flag is set to true, all occurrences will\
223
+ be replaced. In either case, if the number of occurrences in the file does not match the expectation the function will return an error. \
224
+ In that case try a different approach.'
225
+ : 'A single occurrence of each old content in the tuples is expected to be replaced. If the number of occurrences in the file does not match the expectation,\
226
+ the function will return an error. In that case try a different approach.';
227
+ const applicationText = immediateApplication
228
+ ? 'The changes will be applied immediately without user confirmation.'
229
+ : 'The proposed changes will be applied when the user accepts.';
230
+ const replacementDescription = `Propose to replace sections of content in an existing file by providing a list of tuples with old content to be matched and replaced.
231
+ ${replacementSentence}. For deletions, use an empty new content in the tuple.
232
+ Make sure you use the same line endings and whitespace as in the original file content. ${applicationText}
233
+ Multiple calls for the same file will merge replacements unless the reset parameter is set to true. Use the reset parameter to clear previous changes and start
234
+ fresh if needed.`;
235
+ return {
236
+ description: replacementDescription,
237
+ parameters: replacementParameters
238
+ };
239
+ }
240
+ async createChangesetFromToolCall(toolCallString, ctx) {
241
+ var _a, _b;
242
+ try {
243
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
244
+ return JSON.stringify({ error: 'Operation cancelled by user' });
245
+ }
246
+ const result = await this.processReplacementsCommon(toolCallString, ctx, this.fileChangeSetTitleProvider.getChangeSetTitle(ctx));
247
+ if (result.errors.length > 0) {
248
+ return `Errors encountered: ${result.errors.join('; ')}`;
249
+ }
250
+ if (result.fileElement) {
251
+ const action = result.reset ? 'reset and applied' : 'applied';
252
+ return `Proposed replacements ${action} to file ${result.path}. The user will review and potentially apply the changes.`;
253
+ }
254
+ else {
255
+ return `No changes needed for file ${result.path}. Content already matches the requested state.`;
256
+ }
257
+ }
258
+ catch (error) {
259
+ console.debug('Error processing replacements:', error.message);
260
+ return JSON.stringify({ error: error.message });
261
+ }
262
+ }
263
+ async writeChangesetFromToolCall(toolCallString, ctx) {
264
+ var _a, _b;
265
+ try {
266
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
267
+ return JSON.stringify({ error: 'Operation cancelled by user' });
268
+ }
269
+ const result = await this.processReplacementsCommon(toolCallString, ctx, this.fileChangeSetTitleProvider.getChangeSetTitle(ctx));
270
+ if (result.errors.length > 0) {
271
+ return `Errors encountered: ${result.errors.join('; ')}`;
272
+ }
273
+ if (result.fileElement) {
274
+ // Immediately apply the change
275
+ await result.fileElement.apply();
276
+ const action = result.reset ? 'reset and' : '';
277
+ return `Successfully ${action} applied replacements to file ${result.path}.`;
278
+ }
279
+ else {
280
+ return `No changes needed for file ${result.path}. Content already matches the requested state.`;
281
+ }
282
+ }
283
+ catch (error) {
284
+ console.debug('Error processing replacements:', error.message);
285
+ return JSON.stringify({ error: error.message });
286
+ }
287
+ }
288
+ async processReplacementsCommon(toolCallString, ctx, changeSetTitle) {
289
+ var _a, _b, _c, _d;
290
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
291
+ throw new Error('Operation cancelled by user');
292
+ }
293
+ const { path, replacements, reset } = JSON.parse(toolCallString);
294
+ const fileUri = await this.workspaceFunctionScope.resolveRelativePath(path);
295
+ // Get the starting content - either original file or existing proposed state
296
+ let startingContent;
297
+ if (reset || !ctx.session.changeSet) {
298
+ // Start from original file content
299
+ startingContent = (await this.fileService.read(fileUri)).value.toString();
300
+ }
301
+ else {
302
+ // Start from existing proposed state if available
303
+ const existingElement = this.findExistingChangeElement(ctx.session.changeSet, fileUri);
304
+ if (existingElement) {
305
+ startingContent = existingElement.targetState || (await this.fileService.read(fileUri)).value.toString();
306
+ }
307
+ else {
308
+ startingContent = (await this.fileService.read(fileUri)).value.toString();
309
+ }
310
+ }
311
+ if ((_d = (_c = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _c === void 0 ? void 0 : _c.cancellationToken) === null || _d === void 0 ? void 0 : _d.isCancellationRequested) {
312
+ throw new Error('Operation cancelled by user');
313
+ }
314
+ const { updatedContent, errors } = this.replacer.applyReplacements(startingContent, replacements);
315
+ if (errors.length > 0) {
316
+ return { fileElement: undefined, path, reset: reset || false, errors };
317
+ }
318
+ // Only create/update changeset if content actually changed
319
+ const originalContent = (await this.fileService.read(fileUri)).value.toString();
320
+ if (updatedContent !== originalContent) {
321
+ ctx.session.changeSet.setTitle(changeSetTitle);
322
+ const fileElement = this.fileChangeFactory({
323
+ uri: fileUri,
324
+ type: 'modify',
325
+ state: 'pending',
326
+ targetState: updatedContent,
327
+ requestId: ctx.id,
328
+ chatSessionId: ctx.session.id
329
+ });
330
+ ctx.session.changeSet.addElements(fileElement);
331
+ return { fileElement, path, reset: reset || false, errors: [] };
332
+ }
333
+ else {
334
+ return { fileElement: undefined, path, reset: reset || false, errors: [] };
335
+ }
336
+ }
337
+ findExistingChangeElement(changeSet, fileUri) {
338
+ const element = changeSet.getElementByURI(fileUri);
339
+ if (element instanceof change_set_file_element_1.ChangeSetFileElement) {
340
+ return element;
341
+ }
342
+ }
343
+ async clearFileChanges(path, ctx) {
344
+ var _a, _b;
345
+ try {
346
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
347
+ return JSON.stringify({ error: 'Operation cancelled by user' });
348
+ }
349
+ const fileUri = await this.workspaceFunctionScope.resolveRelativePath(path);
350
+ if (ctx.session.changeSet.removeElements(fileUri)) {
351
+ return `Cleared pending change(s) for file ${path}.`;
352
+ }
353
+ else {
354
+ return `No pending changes found for file ${path}.`;
355
+ }
356
+ }
357
+ catch (error) {
358
+ console.debug('Error clearing file changes:', error.message);
359
+ return JSON.stringify({ error: error.message });
360
+ }
361
+ }
362
+ async getProposedFileState(path, ctx) {
363
+ var _a, _b;
364
+ try {
365
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
366
+ return JSON.stringify({ error: 'Operation cancelled by user' });
367
+ }
368
+ const fileUri = await this.workspaceFunctionScope.resolveRelativePath(path);
369
+ if (!ctx.session.changeSet) {
370
+ // No changeset exists, return original file content
371
+ const originalContent = (await this.fileService.read(fileUri)).value.toString();
372
+ return `File ${path} has no pending changes. Original content:\n\n${originalContent}`;
373
+ }
374
+ const existingElement = this.findExistingChangeElement(ctx.session.changeSet, fileUri);
375
+ if (existingElement && existingElement.targetState) {
376
+ return `File ${path} has pending changes. Proposed content:\n\n${existingElement.targetState}`;
377
+ }
378
+ else {
379
+ // No pending changes for this file
380
+ const originalContent = (await this.fileService.read(fileUri)).value.toString();
381
+ return `File ${path} has no pending changes. Original content:\n\n${originalContent}`;
382
+ }
383
+ }
384
+ catch (error) {
385
+ console.debug('Error getting proposed file state:', error.message);
386
+ return JSON.stringify({ error: error.message });
387
+ }
388
+ }
389
+ };
390
+ exports.ReplaceContentInFileFunctionHelper = ReplaceContentInFileFunctionHelper;
391
+ tslib_1.__decorate([
392
+ (0, inversify_1.inject)(workspace_functions_1.WorkspaceFunctionScope),
393
+ tslib_1.__metadata("design:type", workspace_functions_1.WorkspaceFunctionScope)
394
+ ], ReplaceContentInFileFunctionHelper.prototype, "workspaceFunctionScope", void 0);
395
+ tslib_1.__decorate([
396
+ (0, inversify_1.inject)(file_service_1.FileService),
397
+ tslib_1.__metadata("design:type", file_service_1.FileService)
398
+ ], ReplaceContentInFileFunctionHelper.prototype, "fileService", void 0);
399
+ tslib_1.__decorate([
400
+ (0, inversify_1.inject)(change_set_file_element_1.ChangeSetFileElementFactory),
401
+ tslib_1.__metadata("design:type", Function)
402
+ ], ReplaceContentInFileFunctionHelper.prototype, "fileChangeFactory", void 0);
403
+ tslib_1.__decorate([
404
+ (0, inversify_1.inject)(exports.FileChangeSetTitleProvider),
405
+ tslib_1.__metadata("design:type", Object)
406
+ ], ReplaceContentInFileFunctionHelper.prototype, "fileChangeSetTitleProvider", void 0);
407
+ exports.ReplaceContentInFileFunctionHelper = ReplaceContentInFileFunctionHelper = tslib_1.__decorate([
408
+ (0, inversify_1.injectable)(),
409
+ tslib_1.__metadata("design:paramtypes", [])
410
+ ], ReplaceContentInFileFunctionHelper);
411
+ let SimpleSuggestFileReplacements = SimpleSuggestFileReplacements_1 = class SimpleSuggestFileReplacements {
412
+ getTool() {
413
+ const metadata = this.replaceContentInFileFunctionHelper.getToolMetadata();
414
+ return {
415
+ id: SimpleSuggestFileReplacements_1.ID,
416
+ name: SimpleSuggestFileReplacements_1.ID,
417
+ description: metadata.description,
418
+ parameters: metadata.parameters,
419
+ handler: async (args, ctx) => {
420
+ var _a, _b;
421
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
422
+ return JSON.stringify({ error: 'Operation cancelled by user' });
423
+ }
424
+ return this.replaceContentInFileFunctionHelper.createChangesetFromToolCall(args, ctx);
425
+ }
426
+ };
427
+ }
428
+ };
429
+ exports.SimpleSuggestFileReplacements = SimpleSuggestFileReplacements;
430
+ SimpleSuggestFileReplacements.ID = 'simpleSuggestFileReplacements';
431
+ tslib_1.__decorate([
432
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
433
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
434
+ ], SimpleSuggestFileReplacements.prototype, "replaceContentInFileFunctionHelper", void 0);
435
+ exports.SimpleSuggestFileReplacements = SimpleSuggestFileReplacements = SimpleSuggestFileReplacements_1 = tslib_1.__decorate([
436
+ (0, inversify_1.injectable)()
437
+ ], SimpleSuggestFileReplacements);
438
+ let SimpleWriteFileReplacements = SimpleWriteFileReplacements_1 = class SimpleWriteFileReplacements {
439
+ getTool() {
440
+ const metadata = this.replaceContentInFileFunctionHelper.getToolMetadata(false, true);
441
+ return {
442
+ id: SimpleWriteFileReplacements_1.ID,
443
+ name: SimpleWriteFileReplacements_1.ID,
444
+ description: metadata.description,
445
+ parameters: metadata.parameters,
446
+ handler: async (args, ctx) => {
447
+ var _a, _b;
448
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
449
+ return JSON.stringify({ error: 'Operation cancelled by user' });
450
+ }
451
+ return this.replaceContentInFileFunctionHelper.writeChangesetFromToolCall(args, ctx);
452
+ }
453
+ };
454
+ }
455
+ };
456
+ exports.SimpleWriteFileReplacements = SimpleWriteFileReplacements;
457
+ SimpleWriteFileReplacements.ID = 'simpleWriteFileReplacements';
458
+ tslib_1.__decorate([
459
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
460
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
461
+ ], SimpleWriteFileReplacements.prototype, "replaceContentInFileFunctionHelper", void 0);
462
+ exports.SimpleWriteFileReplacements = SimpleWriteFileReplacements = SimpleWriteFileReplacements_1 = tslib_1.__decorate([
463
+ (0, inversify_1.injectable)()
464
+ ], SimpleWriteFileReplacements);
465
+ let SuggestFileReplacements_Simple = SuggestFileReplacements_Simple_1 = class SuggestFileReplacements_Simple {
466
+ getTool() {
467
+ const metadata = this.replaceContentInFileFunctionHelper.getToolMetadata(true);
468
+ return {
469
+ id: SuggestFileReplacements_Simple_1.ID,
470
+ name: SuggestFileReplacements_Simple_1.ID,
471
+ description: metadata.description,
472
+ parameters: metadata.parameters,
473
+ handler: async (args, ctx) => {
474
+ var _a, _b;
475
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
476
+ return JSON.stringify({ error: 'Operation cancelled by user' });
477
+ }
478
+ return this.replaceContentInFileFunctionHelper.createChangesetFromToolCall(args, ctx);
479
+ }
480
+ };
481
+ }
482
+ };
483
+ exports.SuggestFileReplacements_Simple = SuggestFileReplacements_Simple;
484
+ SuggestFileReplacements_Simple.ID = file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_SIMPLE_ID;
485
+ tslib_1.__decorate([
486
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
487
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
488
+ ], SuggestFileReplacements_Simple.prototype, "replaceContentInFileFunctionHelper", void 0);
489
+ exports.SuggestFileReplacements_Simple = SuggestFileReplacements_Simple = SuggestFileReplacements_Simple_1 = tslib_1.__decorate([
490
+ (0, inversify_1.injectable)()
491
+ ], SuggestFileReplacements_Simple);
492
+ let WriteFileReplacements = WriteFileReplacements_1 = class WriteFileReplacements {
493
+ getTool() {
494
+ const metadata = this.replaceContentInFileFunctionHelper.getToolMetadata(true, true);
495
+ return {
496
+ id: WriteFileReplacements_1.ID,
497
+ name: WriteFileReplacements_1.ID,
498
+ description: metadata.description,
499
+ parameters: metadata.parameters,
500
+ handler: async (args, ctx) => {
501
+ var _a, _b;
502
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
503
+ return JSON.stringify({ error: 'Operation cancelled by user' });
504
+ }
505
+ return this.replaceContentInFileFunctionHelper.writeChangesetFromToolCall(args, ctx);
506
+ }
507
+ };
508
+ }
509
+ };
510
+ exports.WriteFileReplacements = WriteFileReplacements;
511
+ WriteFileReplacements.ID = file_changeset_function_ids_1.WRITE_FILE_REPLACEMENTS_ID;
512
+ tslib_1.__decorate([
513
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
514
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
515
+ ], WriteFileReplacements.prototype, "replaceContentInFileFunctionHelper", void 0);
516
+ exports.WriteFileReplacements = WriteFileReplacements = WriteFileReplacements_1 = tslib_1.__decorate([
517
+ (0, inversify_1.injectable)()
518
+ ], WriteFileReplacements);
519
+ let ClearFileChanges = ClearFileChanges_1 = class ClearFileChanges {
520
+ getTool() {
521
+ return {
522
+ id: ClearFileChanges_1.ID,
523
+ name: ClearFileChanges_1.ID,
524
+ description: 'Clears all pending changes for a specific file, allowing you to start fresh with new modifications.',
525
+ parameters: {
526
+ type: 'object',
527
+ properties: {
528
+ path: {
529
+ type: 'string',
530
+ description: 'The path of the file to clear pending changes for.'
531
+ }
532
+ },
533
+ required: ['path']
534
+ },
535
+ handler: async (args, ctx) => {
536
+ var _a, _b;
537
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
538
+ return JSON.stringify({ error: 'Operation cancelled by user' });
539
+ }
540
+ const { path } = JSON.parse(args);
541
+ return this.replaceContentInFileFunctionHelper.clearFileChanges(path, ctx);
542
+ }
543
+ };
544
+ }
545
+ };
546
+ exports.ClearFileChanges = ClearFileChanges;
547
+ ClearFileChanges.ID = file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID;
548
+ tslib_1.__decorate([
549
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
550
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
551
+ ], ClearFileChanges.prototype, "replaceContentInFileFunctionHelper", void 0);
552
+ exports.ClearFileChanges = ClearFileChanges = ClearFileChanges_1 = tslib_1.__decorate([
553
+ (0, inversify_1.injectable)()
554
+ ], ClearFileChanges);
555
+ let GetProposedFileState = class GetProposedFileState {
556
+ getTool() {
557
+ return {
558
+ id: file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID,
559
+ name: file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID,
560
+ description: 'Returns the current proposed state of a file, including all pending changes that have been proposed ' +
561
+ 'but not yet applied. This allows you to inspect the current state before making additional changes.',
562
+ parameters: {
563
+ type: 'object',
564
+ properties: {
565
+ path: {
566
+ type: 'string',
567
+ description: 'The path of the file to get the proposed state for.'
568
+ }
569
+ },
570
+ required: ['path']
571
+ },
572
+ handler: async (args, ctx) => {
573
+ var _a, _b;
574
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
575
+ return JSON.stringify({ error: 'Operation cancelled by user' });
576
+ }
577
+ const { path } = JSON.parse(args);
578
+ return this.replaceContentInFileFunctionHelper.getProposedFileState(path, ctx);
579
+ }
580
+ };
581
+ }
582
+ };
583
+ exports.GetProposedFileState = GetProposedFileState;
584
+ GetProposedFileState.ID = file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID;
585
+ tslib_1.__decorate([
586
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelper),
587
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelper)
588
+ ], GetProposedFileState.prototype, "replaceContentInFileFunctionHelper", void 0);
589
+ exports.GetProposedFileState = GetProposedFileState = tslib_1.__decorate([
590
+ (0, inversify_1.injectable)()
591
+ ], GetProposedFileState);
592
+ let ReplaceContentInFileFunctionHelperV2 = class ReplaceContentInFileFunctionHelperV2 extends ReplaceContentInFileFunctionHelper {
593
+ constructor() {
594
+ super();
595
+ this.setReplacer(new content_replacer_v2_impl_1.ContentReplacerV2Impl());
596
+ }
597
+ };
598
+ exports.ReplaceContentInFileFunctionHelperV2 = ReplaceContentInFileFunctionHelperV2;
599
+ exports.ReplaceContentInFileFunctionHelperV2 = ReplaceContentInFileFunctionHelperV2 = tslib_1.__decorate([
600
+ (0, inversify_1.injectable)(),
601
+ tslib_1.__metadata("design:paramtypes", [])
602
+ ], ReplaceContentInFileFunctionHelperV2);
603
+ let SuggestFileReplacements = SuggestFileReplacements_1 = class SuggestFileReplacements {
604
+ getTool() {
605
+ const metadata = this.replaceContentInFileFunctionHelper.getToolMetadata(true);
606
+ return {
607
+ id: SuggestFileReplacements_1.ID,
608
+ name: SuggestFileReplacements_1.ID,
609
+ description: `Proposes to replace sections of content in an existing file by providing a list of replacements.
610
+ Each replacement consists of oldContent to be matched and newContent to insert in its place.
611
+ By default, a single occurrence of each oldContent is expected. If the 'multiple' flag is set to true, all occurrences will be replaced.
612
+ If the expected number of occurrences is not found, the function will return an error. In this case try a different approach.
613
+ For deletions, use an empty newContent.
614
+ The proposed changes will be applied when the user accepts.
615
+ Multiple calls for the same file will merge replacements unless the reset parameter is set to true.`,
616
+ parameters: metadata.parameters,
617
+ handler: async (args, ctx) => {
618
+ var _a, _b;
619
+ if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.response) === null || _a === void 0 ? void 0 : _a.cancellationToken) === null || _b === void 0 ? void 0 : _b.isCancellationRequested) {
620
+ return JSON.stringify({ error: 'Operation cancelled by user' });
621
+ }
622
+ return this.replaceContentInFileFunctionHelper.createChangesetFromToolCall(args, ctx);
623
+ }
624
+ };
625
+ }
626
+ };
627
+ exports.SuggestFileReplacements = SuggestFileReplacements;
628
+ SuggestFileReplacements.ID = file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID;
629
+ tslib_1.__decorate([
630
+ (0, inversify_1.inject)(ReplaceContentInFileFunctionHelperV2),
631
+ tslib_1.__metadata("design:type", ReplaceContentInFileFunctionHelperV2)
632
+ ], SuggestFileReplacements.prototype, "replaceContentInFileFunctionHelper", void 0);
633
+ exports.SuggestFileReplacements = SuggestFileReplacements = SuggestFileReplacements_1 = tslib_1.__decorate([
634
+ (0, inversify_1.injectable)()
635
+ ], SuggestFileReplacements);
636
+ let DefaultFileChangeSetTitleProvider = class DefaultFileChangeSetTitleProvider {
637
+ getChangeSetTitle(ctx) {
638
+ return core_1.nls.localize('theia/ai-chat/fileChangeSetTitle', 'Changes proposed');
639
+ }
640
+ };
641
+ exports.DefaultFileChangeSetTitleProvider = DefaultFileChangeSetTitleProvider;
642
+ exports.DefaultFileChangeSetTitleProvider = DefaultFileChangeSetTitleProvider = tslib_1.__decorate([
643
+ (0, inversify_1.injectable)()
644
+ ], DefaultFileChangeSetTitleProvider);
645
+ //# sourceMappingURL=file-changeset-functions.js.map