@opensumi/ide-ai-native 3.7.2-next-1740450374.0 → 3.7.2-next-1741226843.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/lib/browser/ai-core.contextkeys.d.ts +0 -1
  2. package/lib/browser/ai-core.contextkeys.d.ts.map +1 -1
  3. package/lib/browser/ai-core.contextkeys.js +0 -1
  4. package/lib/browser/ai-core.contextkeys.js.map +1 -1
  5. package/lib/browser/ai-core.contribution.d.ts +2 -8
  6. package/lib/browser/ai-core.contribution.d.ts.map +1 -1
  7. package/lib/browser/ai-core.contribution.js +20 -149
  8. package/lib/browser/ai-core.contribution.js.map +1 -1
  9. package/lib/browser/chat/chat-agent.service.d.ts.map +1 -1
  10. package/lib/browser/chat/chat-agent.service.js +0 -6
  11. package/lib/browser/chat/chat-agent.service.js.map +1 -1
  12. package/lib/browser/chat/chat-manager.service.d.ts +2 -30
  13. package/lib/browser/chat/chat-manager.service.d.ts.map +1 -1
  14. package/lib/browser/chat/chat-manager.service.js +1 -45
  15. package/lib/browser/chat/chat-manager.service.js.map +1 -1
  16. package/lib/browser/chat/chat-model.d.ts +7 -34
  17. package/lib/browser/chat/chat-model.d.ts.map +1 -1
  18. package/lib/browser/chat/chat-model.js +57 -71
  19. package/lib/browser/chat/chat-model.js.map +1 -1
  20. package/lib/browser/chat/chat-proxy.service.d.ts +1 -6
  21. package/lib/browser/chat/chat-proxy.service.d.ts.map +1 -1
  22. package/lib/browser/chat/chat-proxy.service.js +3 -54
  23. package/lib/browser/chat/chat-proxy.service.js.map +1 -1
  24. package/lib/browser/chat/chat.api.service.d.ts +1 -1
  25. package/lib/browser/chat/chat.api.service.d.ts.map +1 -1
  26. package/lib/browser/chat/chat.api.service.js +2 -2
  27. package/lib/browser/chat/chat.api.service.js.map +1 -1
  28. package/lib/browser/chat/chat.internal.service.d.ts +2 -8
  29. package/lib/browser/chat/chat.internal.service.d.ts.map +1 -1
  30. package/lib/browser/chat/chat.internal.service.js +13 -41
  31. package/lib/browser/chat/chat.internal.service.js.map +1 -1
  32. package/lib/browser/chat/chat.module.less +41 -17
  33. package/lib/browser/chat/chat.view.d.ts.map +1 -1
  34. package/lib/browser/chat/chat.view.js +14 -102
  35. package/lib/browser/chat/chat.view.js.map +1 -1
  36. package/lib/browser/components/ChatEditor.d.ts +0 -1
  37. package/lib/browser/components/ChatEditor.d.ts.map +1 -1
  38. package/lib/browser/components/ChatEditor.js +3 -3
  39. package/lib/browser/components/ChatEditor.js.map +1 -1
  40. package/lib/browser/components/ChatInput.d.ts.map +1 -1
  41. package/lib/browser/components/ChatInput.js.map +1 -1
  42. package/lib/browser/components/ChatMarkdown.d.ts +0 -1
  43. package/lib/browser/components/ChatMarkdown.d.ts.map +1 -1
  44. package/lib/browser/components/ChatMarkdown.js +2 -2
  45. package/lib/browser/components/ChatMarkdown.js.map +1 -1
  46. package/lib/browser/components/ChatReply.d.ts.map +1 -1
  47. package/lib/browser/components/ChatReply.js +4 -29
  48. package/lib/browser/components/ChatReply.js.map +1 -1
  49. package/lib/browser/components/ChatThinking.js +1 -1
  50. package/lib/browser/components/ChatThinking.js.map +1 -1
  51. package/lib/browser/components/WelcomeMsg.js.map +1 -1
  52. package/lib/browser/components/components.module.less +31 -33
  53. package/lib/browser/components/utils.d.ts +2 -2
  54. package/lib/browser/contrib/intelligent-completions/index.d.ts +9 -16
  55. package/lib/browser/contrib/intelligent-completions/index.d.ts.map +1 -1
  56. package/lib/browser/contrib/intelligent-completions/index.js +1 -6
  57. package/lib/browser/contrib/intelligent-completions/index.js.map +1 -1
  58. package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts +0 -1
  59. package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts.map +1 -1
  60. package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js +4 -26
  61. package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js.map +1 -1
  62. package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts +5 -5
  63. package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts.map +1 -1
  64. package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js +48 -59
  65. package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js.map +1 -1
  66. package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.d.ts +0 -4
  67. package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.d.ts.map +1 -1
  68. package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.js +0 -7
  69. package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.js.map +1 -1
  70. package/lib/browser/contrib/intelligent-completions/source/base.d.ts +5 -14
  71. package/lib/browser/contrib/intelligent-completions/source/base.d.ts.map +1 -1
  72. package/lib/browser/contrib/intelligent-completions/source/base.js +8 -29
  73. package/lib/browser/contrib/intelligent-completions/source/base.js.map +1 -1
  74. package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts +3 -10
  75. package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts.map +1 -1
  76. package/lib/browser/contrib/intelligent-completions/source/line-change.source.js +22 -95
  77. package/lib/browser/contrib/intelligent-completions/source/line-change.source.js.map +1 -1
  78. package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts +3 -1
  79. package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts.map +1 -1
  80. package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js +20 -13
  81. package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js.map +1 -1
  82. package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js +2 -2
  83. package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js.map +1 -1
  84. package/lib/browser/index.d.ts +3 -11
  85. package/lib/browser/index.d.ts.map +1 -1
  86. package/lib/browser/index.js +4 -56
  87. package/lib/browser/index.js.map +1 -1
  88. package/lib/browser/languages/tree-sitter/wasm-manager.d.ts.map +1 -1
  89. package/lib/browser/languages/tree-sitter/wasm-manager.js +2 -14
  90. package/lib/browser/languages/tree-sitter/wasm-manager.js.map +1 -1
  91. package/lib/browser/layout/ai-layout.d.ts.map +1 -1
  92. package/lib/browser/layout/ai-layout.js +2 -2
  93. package/lib/browser/layout/ai-layout.js.map +1 -1
  94. package/lib/browser/layout/layout.module.less +9 -9
  95. package/lib/browser/layout/tabbar.view.d.ts.map +1 -1
  96. package/lib/browser/layout/tabbar.view.js +6 -5
  97. package/lib/browser/layout/tabbar.view.js.map +1 -1
  98. package/lib/browser/model/enhanceDecorationsCollection.d.ts +10 -14
  99. package/lib/browser/model/enhanceDecorationsCollection.d.ts.map +1 -1
  100. package/lib/browser/model/enhanceDecorationsCollection.js +53 -42
  101. package/lib/browser/model/enhanceDecorationsCollection.js.map +1 -1
  102. package/lib/browser/model/msg-history-manager.d.ts +1 -20
  103. package/lib/browser/model/msg-history-manager.d.ts.map +1 -1
  104. package/lib/browser/model/msg-history-manager.js +10 -46
  105. package/lib/browser/model/msg-history-manager.js.map +1 -1
  106. package/lib/browser/model/styles.module.less +7 -0
  107. package/lib/browser/preferences/schema.d.ts.map +1 -1
  108. package/lib/browser/preferences/schema.js +0 -69
  109. package/lib/browser/preferences/schema.js.map +1 -1
  110. package/lib/browser/types.d.ts +4 -74
  111. package/lib/browser/types.d.ts.map +1 -1
  112. package/lib/browser/types.js +1 -4
  113. package/lib/browser/types.js.map +1 -1
  114. package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts +1 -2
  115. package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts.map +1 -1
  116. package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js +49 -21
  117. package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js.map +1 -1
  118. package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts +13 -3
  119. package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts.map +1 -1
  120. package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js +72 -24
  121. package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js.map +1 -1
  122. package/lib/browser/widget/inline-chat/inline-chat.service.d.ts +6 -1
  123. package/lib/browser/widget/inline-chat/inline-chat.service.d.ts.map +1 -1
  124. package/lib/browser/widget/inline-chat/inline-chat.service.js +17 -5
  125. package/lib/browser/widget/inline-chat/inline-chat.service.js.map +1 -1
  126. package/lib/browser/widget/inline-chat/inline-content-widget.d.ts +5 -2
  127. package/lib/browser/widget/inline-chat/inline-content-widget.d.ts.map +1 -1
  128. package/lib/browser/widget/inline-chat/inline-content-widget.js +42 -17
  129. package/lib/browser/widget/inline-chat/inline-content-widget.js.map +1 -1
  130. package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts +5 -22
  131. package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts.map +1 -1
  132. package/lib/browser/widget/inline-diff/inline-diff-previewer.js +30 -61
  133. package/lib/browser/widget/inline-diff/inline-diff-previewer.js.map +1 -1
  134. package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts +12 -8
  135. package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts.map +1 -1
  136. package/lib/browser/widget/inline-diff/inline-diff.controller.js +96 -68
  137. package/lib/browser/widget/inline-diff/inline-diff.controller.js.map +1 -1
  138. package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts +1 -0
  139. package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts.map +1 -1
  140. package/lib/browser/widget/inline-hint/inline-hint.controller.js +5 -0
  141. package/lib/browser/widget/inline-hint/inline-hint.controller.js.map +1 -1
  142. package/lib/browser/widget/inline-input/inline-input-widget.d.ts +2 -12
  143. package/lib/browser/widget/inline-input/inline-input-widget.d.ts.map +1 -1
  144. package/lib/browser/widget/inline-input/inline-input-widget.js +18 -26
  145. package/lib/browser/widget/inline-input/inline-input-widget.js.map +1 -1
  146. package/lib/browser/widget/inline-input/inline-input.controller.d.ts +5 -14
  147. package/lib/browser/widget/inline-input/inline-input.controller.d.ts.map +1 -1
  148. package/lib/browser/widget/inline-input/inline-input.controller.js +165 -321
  149. package/lib/browser/widget/inline-input/inline-input.controller.js.map +1 -1
  150. package/lib/browser/widget/inline-input/inline-input.module.less +0 -4
  151. package/lib/browser/widget/inline-input/inline-input.service.d.ts +7 -19
  152. package/lib/browser/widget/inline-input/inline-input.service.d.ts.map +1 -1
  153. package/lib/browser/widget/inline-input/inline-input.service.js +12 -72
  154. package/lib/browser/widget/inline-input/inline-input.service.js.map +1 -1
  155. package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts +19 -9
  156. package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts.map +1 -1
  157. package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js +39 -47
  158. package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js.map +1 -1
  159. package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts +4 -21
  160. package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts.map +1 -1
  161. package/lib/browser/widget/inline-stream-diff/live-preview.component.js +5 -37
  162. package/lib/browser/widget/inline-stream-diff/live-preview.component.js.map +1 -1
  163. package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts +11 -7
  164. package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts.map +1 -1
  165. package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js +77 -34
  166. package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js.map +1 -1
  167. package/lib/common/index.d.ts +0 -10
  168. package/lib/common/index.d.ts.map +1 -1
  169. package/lib/common/index.js +1 -4
  170. package/lib/common/index.js.map +1 -1
  171. package/lib/common/types.d.ts +0 -17
  172. package/lib/common/types.d.ts.map +1 -1
  173. package/lib/common/utils.d.ts +0 -1
  174. package/lib/common/utils.d.ts.map +1 -1
  175. package/lib/common/utils.js +3 -5
  176. package/lib/common/utils.js.map +1 -1
  177. package/lib/node/index.d.ts.map +1 -1
  178. package/lib/node/index.js +0 -19
  179. package/lib/node/index.js.map +1 -1
  180. package/package.json +22 -33
  181. package/src/browser/ai-core.contextkeys.ts +0 -3
  182. package/src/browser/ai-core.contribution.ts +21 -167
  183. package/src/browser/chat/chat-agent.service.ts +0 -7
  184. package/src/browser/chat/chat-manager.service.ts +7 -83
  185. package/src/browser/chat/chat-model.ts +20 -86
  186. package/src/browser/chat/chat-proxy.service.ts +3 -55
  187. package/src/browser/chat/chat.api.service.ts +2 -2
  188. package/src/browser/chat/chat.internal.service.ts +6 -35
  189. package/src/browser/chat/chat.module.less +41 -17
  190. package/src/browser/chat/chat.view.tsx +45 -191
  191. package/src/browser/components/ChatEditor.tsx +10 -13
  192. package/src/browser/components/ChatInput.tsx +0 -1
  193. package/src/browser/components/ChatMarkdown.tsx +2 -4
  194. package/src/browser/components/ChatReply.tsx +9 -38
  195. package/src/browser/components/ChatThinking.tsx +1 -1
  196. package/src/browser/components/WelcomeMsg.tsx +1 -1
  197. package/src/browser/components/components.module.less +31 -33
  198. package/src/browser/contrib/intelligent-completions/index.ts +4 -19
  199. package/src/browser/contrib/intelligent-completions/intelligent-completions.contribution.ts +8 -32
  200. package/src/browser/contrib/intelligent-completions/intelligent-completions.controller.ts +67 -102
  201. package/src/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.ts +0 -11
  202. package/src/browser/contrib/intelligent-completions/source/base.ts +14 -39
  203. package/src/browser/contrib/intelligent-completions/source/line-change.source.ts +22 -129
  204. package/src/browser/contrib/intelligent-completions/source/lint-error.source.ts +31 -19
  205. package/src/browser/contrib/terminal/component/terminal-command-suggest-controller.tsx +1 -1
  206. package/src/browser/index.ts +6 -69
  207. package/src/browser/languages/tree-sitter/wasm-manager.ts +2 -12
  208. package/src/browser/layout/ai-layout.tsx +2 -5
  209. package/src/browser/layout/layout.module.less +9 -9
  210. package/src/browser/layout/tabbar.view.tsx +8 -10
  211. package/src/browser/model/enhanceDecorationsCollection.ts +77 -62
  212. package/src/browser/model/msg-history-manager.ts +2 -56
  213. package/src/browser/model/styles.module.less +7 -0
  214. package/src/browser/preferences/schema.ts +0 -69
  215. package/src/browser/types.ts +5 -100
  216. package/src/browser/widget/inline-chat/inline-chat-editor.controller.ts +65 -30
  217. package/src/browser/widget/inline-chat/inline-chat.feature.registry.ts +90 -23
  218. package/src/browser/widget/inline-chat/inline-chat.service.ts +17 -2
  219. package/src/browser/widget/inline-chat/inline-content-widget.tsx +69 -14
  220. package/src/browser/widget/inline-diff/inline-diff-previewer.ts +32 -87
  221. package/src/browser/widget/inline-diff/inline-diff.controller.ts +114 -90
  222. package/src/browser/widget/inline-hint/inline-hint.controller.ts +7 -1
  223. package/src/browser/widget/inline-input/inline-input-widget.tsx +12 -34
  224. package/src/browser/widget/inline-input/inline-input.controller.ts +242 -454
  225. package/src/browser/widget/inline-input/inline-input.module.less +0 -4
  226. package/src/browser/widget/inline-input/inline-input.service.ts +13 -92
  227. package/src/browser/widget/inline-stream-diff/inline-stream-diff.handler.tsx +67 -58
  228. package/src/browser/widget/inline-stream-diff/live-preview.component.tsx +6 -49
  229. package/src/browser/widget/inline-stream-diff/live-preview.decoration.tsx +112 -41
  230. package/src/common/index.ts +0 -15
  231. package/src/common/types.ts +0 -22
  232. package/src/common/utils.ts +2 -4
  233. package/src/node/index.ts +0 -21
  234. package/lib/browser/components/ChatContext/ContextSelector.d.ts +0 -12
  235. package/lib/browser/components/ChatContext/ContextSelector.d.ts.map +0 -1
  236. package/lib/browser/components/ChatContext/ContextSelector.js +0 -113
  237. package/lib/browser/components/ChatContext/ContextSelector.js.map +0 -1
  238. package/lib/browser/components/ChatContext/index.d.ts +0 -4
  239. package/lib/browser/components/ChatContext/index.d.ts.map +0 -1
  240. package/lib/browser/components/ChatContext/index.js +0 -100
  241. package/lib/browser/components/ChatContext/index.js.map +0 -1
  242. package/lib/browser/components/ChatContext/style.module.less +0 -201
  243. package/lib/browser/components/ChatHistory.d.ts +0 -21
  244. package/lib/browser/components/ChatHistory.d.ts.map +0 -1
  245. package/lib/browser/components/ChatHistory.js +0 -148
  246. package/lib/browser/components/ChatHistory.js.map +0 -1
  247. package/lib/browser/components/ChatToolRender.d.ts +0 -7
  248. package/lib/browser/components/ChatToolRender.d.ts.map +0 -1
  249. package/lib/browser/components/ChatToolRender.js +0 -71
  250. package/lib/browser/components/ChatToolRender.js.map +0 -1
  251. package/lib/browser/components/ChatToolRender.module.less +0 -86
  252. package/lib/browser/components/chat-history.css +0 -139
  253. package/lib/browser/context/llm-context.contribution.d.ts +0 -7
  254. package/lib/browser/context/llm-context.contribution.d.ts.map +0 -1
  255. package/lib/browser/context/llm-context.contribution.js +0 -21
  256. package/lib/browser/context/llm-context.contribution.js.map +0 -1
  257. package/lib/browser/context/llm-context.service.d.ts +0 -36
  258. package/lib/browser/context/llm-context.service.d.ts.map +0 -1
  259. package/lib/browser/context/llm-context.service.js +0 -170
  260. package/lib/browser/context/llm-context.service.js.map +0 -1
  261. package/lib/browser/contrib/intelligent-completions/source/trigger.source.d.ts +0 -13
  262. package/lib/browser/contrib/intelligent-completions/source/trigger.source.d.ts.map +0 -1
  263. package/lib/browser/contrib/intelligent-completions/source/trigger.source.js +0 -36
  264. package/lib/browser/contrib/intelligent-completions/source/trigger.source.js.map +0 -1
  265. package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts +0 -9
  266. package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts.map +0 -1
  267. package/lib/browser/contrib/intelligent-completions/source/typing.source.js +0 -36
  268. package/lib/browser/contrib/intelligent-completions/source/typing.source.js.map +0 -1
  269. package/lib/browser/mcp/base-apply.service.d.ts +0 -67
  270. package/lib/browser/mcp/base-apply.service.d.ts.map +0 -1
  271. package/lib/browser/mcp/base-apply.service.js +0 -290
  272. package/lib/browser/mcp/base-apply.service.js.map +0 -1
  273. package/lib/browser/mcp/mcp-server-proxy.service.d.ts +0 -30
  274. package/lib/browser/mcp/mcp-server-proxy.service.d.ts.map +0 -1
  275. package/lib/browser/mcp/mcp-server-proxy.service.js +0 -57
  276. package/lib/browser/mcp/mcp-server-proxy.service.js.map +0 -1
  277. package/lib/browser/mcp/mcp-server.feature.registry.d.ts +0 -20
  278. package/lib/browser/mcp/mcp-server.feature.registry.d.ts.map +0 -1
  279. package/lib/browser/mcp/mcp-server.feature.registry.js +0 -69
  280. package/lib/browser/mcp/mcp-server.feature.registry.js.map +0 -1
  281. package/lib/browser/mcp/mcp-tools-dialog.module.less +0 -44
  282. package/lib/browser/mcp/mcp-tools-dialog.view.d.ts +0 -8
  283. package/lib/browser/mcp/mcp-tools-dialog.view.d.ts.map +0 -1
  284. package/lib/browser/mcp/mcp-tools-dialog.view.js +0 -16
  285. package/lib/browser/mcp/mcp-tools-dialog.view.js.map +0 -1
  286. package/lib/browser/mcp/tools/components/EditFile.d.ts +0 -3
  287. package/lib/browser/mcp/tools/components/EditFile.d.ts.map +0 -1
  288. package/lib/browser/mcp/tools/components/EditFile.js +0 -101
  289. package/lib/browser/mcp/tools/components/EditFile.js.map +0 -1
  290. package/lib/browser/mcp/tools/components/SearchResult.d.ts +0 -11
  291. package/lib/browser/mcp/tools/components/SearchResult.d.ts.map +0 -1
  292. package/lib/browser/mcp/tools/components/SearchResult.js +0 -60
  293. package/lib/browser/mcp/tools/components/SearchResult.js.map +0 -1
  294. package/lib/browser/mcp/tools/components/Terminal.d.ts +0 -4
  295. package/lib/browser/mcp/tools/components/Terminal.d.ts.map +0 -1
  296. package/lib/browser/mcp/tools/components/Terminal.js +0 -64
  297. package/lib/browser/mcp/tools/components/Terminal.js.map +0 -1
  298. package/lib/browser/mcp/tools/components/index.module.less +0 -168
  299. package/lib/browser/mcp/tools/createNewFileWithText.d.ts +0 -9
  300. package/lib/browser/mcp/tools/createNewFileWithText.d.ts.map +0 -1
  301. package/lib/browser/mcp/tools/createNewFileWithText.js +0 -82
  302. package/lib/browser/mcp/tools/createNewFileWithText.js.map +0 -1
  303. package/lib/browser/mcp/tools/editFile.d.ts +0 -8
  304. package/lib/browser/mcp/tools/editFile.d.ts.map +0 -1
  305. package/lib/browser/mcp/tools/editFile.js +0 -95
  306. package/lib/browser/mcp/tools/editFile.js.map +0 -1
  307. package/lib/browser/mcp/tools/fileSearch.d.ts +0 -10
  308. package/lib/browser/mcp/tools/fileSearch.d.ts.map +0 -1
  309. package/lib/browser/mcp/tools/fileSearch.js +0 -94
  310. package/lib/browser/mcp/tools/fileSearch.js.map +0 -1
  311. package/lib/browser/mcp/tools/getDiagnosticsByPath.d.ts +0 -10
  312. package/lib/browser/mcp/tools/getDiagnosticsByPath.d.ts.map +0 -1
  313. package/lib/browser/mcp/tools/getDiagnosticsByPath.js +0 -118
  314. package/lib/browser/mcp/tools/getDiagnosticsByPath.js.map +0 -1
  315. package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.d.ts +0 -11
  316. package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.d.ts.map +0 -1
  317. package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js +0 -118
  318. package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js.map +0 -1
  319. package/lib/browser/mcp/tools/grepSearch.d.ts +0 -10
  320. package/lib/browser/mcp/tools/grepSearch.d.ts.map +0 -1
  321. package/lib/browser/mcp/tools/grepSearch.js +0 -118
  322. package/lib/browser/mcp/tools/grepSearch.js.map +0 -1
  323. package/lib/browser/mcp/tools/handlers/EditFile.d.ts +0 -10
  324. package/lib/browser/mcp/tools/handlers/EditFile.d.ts.map +0 -1
  325. package/lib/browser/mcp/tools/handlers/EditFile.js +0 -28
  326. package/lib/browser/mcp/tools/handlers/EditFile.js.map +0 -1
  327. package/lib/browser/mcp/tools/handlers/ListDir.d.ts +0 -21
  328. package/lib/browser/mcp/tools/handlers/ListDir.d.ts.map +0 -1
  329. package/lib/browser/mcp/tools/handlers/ListDir.js +0 -112
  330. package/lib/browser/mcp/tools/handlers/ListDir.js.map +0 -1
  331. package/lib/browser/mcp/tools/handlers/ReadFile.d.ts +0 -53
  332. package/lib/browser/mcp/tools/handlers/ReadFile.d.ts.map +0 -1
  333. package/lib/browser/mcp/tools/handlers/ReadFile.js +0 -161
  334. package/lib/browser/mcp/tools/handlers/ReadFile.js.map +0 -1
  335. package/lib/browser/mcp/tools/handlers/RunCommand.d.ts +0 -43
  336. package/lib/browser/mcp/tools/handlers/RunCommand.d.ts.map +0 -1
  337. package/lib/browser/mcp/tools/handlers/RunCommand.js +0 -104
  338. package/lib/browser/mcp/tools/handlers/RunCommand.js.map +0 -1
  339. package/lib/browser/mcp/tools/handlers/utils.d.ts +0 -2
  340. package/lib/browser/mcp/tools/handlers/utils.d.ts.map +0 -1
  341. package/lib/browser/mcp/tools/handlers/utils.js +0 -7
  342. package/lib/browser/mcp/tools/handlers/utils.js.map +0 -1
  343. package/lib/browser/mcp/tools/listDir.d.ts +0 -8
  344. package/lib/browser/mcp/tools/listDir.d.ts.map +0 -1
  345. package/lib/browser/mcp/tools/listDir.js +0 -64
  346. package/lib/browser/mcp/tools/listDir.js.map +0 -1
  347. package/lib/browser/mcp/tools/readFile.d.ts +0 -8
  348. package/lib/browser/mcp/tools/readFile.d.ts.map +0 -1
  349. package/lib/browser/mcp/tools/readFile.js +0 -81
  350. package/lib/browser/mcp/tools/readFile.js.map +0 -1
  351. package/lib/browser/mcp/tools/runTerminalCmd.d.ts +0 -13
  352. package/lib/browser/mcp/tools/runTerminalCmd.d.ts.map +0 -1
  353. package/lib/browser/mcp/tools/runTerminalCmd.js +0 -49
  354. package/lib/browser/mcp/tools/runTerminalCmd.js.map +0 -1
  355. package/lib/browser/widget/inline-input/model.d.ts +0 -34
  356. package/lib/browser/widget/inline-input/model.d.ts.map +0 -1
  357. package/lib/browser/widget/inline-input/model.js +0 -63
  358. package/lib/browser/widget/inline-input/model.js.map +0 -1
  359. package/lib/common/llm-context.d.ts +0 -40
  360. package/lib/common/llm-context.d.ts.map +0 -1
  361. package/lib/common/llm-context.js +0 -5
  362. package/lib/common/llm-context.js.map +0 -1
  363. package/lib/common/mcp-server-manager.d.ts +0 -40
  364. package/lib/common/mcp-server-manager.d.ts.map +0 -1
  365. package/lib/common/mcp-server-manager.js +0 -6
  366. package/lib/common/mcp-server-manager.js.map +0 -1
  367. package/lib/common/prompts/context-prompt-provider.d.ts +0 -14
  368. package/lib/common/prompts/context-prompt-provider.d.ts.map +0 -1
  369. package/lib/common/prompts/context-prompt-provider.js +0 -38
  370. package/lib/common/prompts/context-prompt-provider.js.map +0 -1
  371. package/lib/common/tool-invocation-registry.d.ts +0 -92
  372. package/lib/common/tool-invocation-registry.d.ts.map +0 -1
  373. package/lib/common/tool-invocation-registry.js +0 -90
  374. package/lib/common/tool-invocation-registry.js.map +0 -1
  375. package/lib/node/anthropic/anthropic-language-model.d.ts +0 -9
  376. package/lib/node/anthropic/anthropic-language-model.d.ts.map +0 -1
  377. package/lib/node/anthropic/anthropic-language-model.js +0 -26
  378. package/lib/node/anthropic/anthropic-language-model.js.map +0 -1
  379. package/lib/node/base-language-model.d.ts +0 -14
  380. package/lib/node/base-language-model.d.ts.map +0 -1
  381. package/lib/node/base-language-model.js +0 -140
  382. package/lib/node/base-language-model.js.map +0 -1
  383. package/lib/node/deepseek/deepseek-language-model.d.ts +0 -9
  384. package/lib/node/deepseek/deepseek-language-model.d.ts.map +0 -1
  385. package/lib/node/deepseek/deepseek-language-model.js +0 -26
  386. package/lib/node/deepseek/deepseek-language-model.js.map +0 -1
  387. package/lib/node/mcp/sumi-mcp-server.d.ts +0 -91
  388. package/lib/node/mcp/sumi-mcp-server.d.ts.map +0 -1
  389. package/lib/node/mcp/sumi-mcp-server.js +0 -175
  390. package/lib/node/mcp/sumi-mcp-server.js.map +0 -1
  391. package/lib/node/mcp-server-manager-impl.d.ts +0 -27
  392. package/lib/node/mcp-server-manager-impl.d.ts.map +0 -1
  393. package/lib/node/mcp-server-manager-impl.js +0 -128
  394. package/lib/node/mcp-server-manager-impl.js.map +0 -1
  395. package/lib/node/mcp-server.d.ts +0 -207
  396. package/lib/node/mcp-server.d.ts.map +0 -1
  397. package/lib/node/mcp-server.js +0 -92
  398. package/lib/node/mcp-server.js.map +0 -1
  399. package/lib/node/openai/openai-language-model.d.ts +0 -9
  400. package/lib/node/openai/openai-language-model.d.ts.map +0 -1
  401. package/lib/node/openai/openai-language-model.js +0 -29
  402. package/lib/node/openai/openai-language-model.js.map +0 -1
  403. package/src/browser/components/ChatContext/ContextSelector.tsx +0 -177
  404. package/src/browser/components/ChatContext/index.tsx +0 -151
  405. package/src/browser/components/ChatContext/style.module.less +0 -201
  406. package/src/browser/components/ChatHistory.tsx +0 -292
  407. package/src/browser/components/ChatToolRender.module.less +0 -86
  408. package/src/browser/components/ChatToolRender.tsx +0 -96
  409. package/src/browser/components/chat-history.css +0 -139
  410. package/src/browser/context/llm-context.contribution.ts +0 -14
  411. package/src/browser/context/llm-context.service.ts +0 -200
  412. package/src/browser/contrib/intelligent-completions/source/trigger.source.ts +0 -44
  413. package/src/browser/contrib/intelligent-completions/source/typing.source.ts +0 -34
  414. package/src/browser/mcp/base-apply.service.ts +0 -349
  415. package/src/browser/mcp/mcp-server-proxy.service.ts +0 -55
  416. package/src/browser/mcp/mcp-server.feature.registry.ts +0 -77
  417. package/src/browser/mcp/mcp-tools-dialog.module.less +0 -44
  418. package/src/browser/mcp/mcp-tools-dialog.view.tsx +0 -24
  419. package/src/browser/mcp/tools/components/EditFile.tsx +0 -144
  420. package/src/browser/mcp/tools/components/SearchResult.tsx +0 -92
  421. package/src/browser/mcp/tools/components/Terminal.tsx +0 -97
  422. package/src/browser/mcp/tools/components/index.module.less +0 -168
  423. package/src/browser/mcp/tools/createNewFileWithText.ts +0 -82
  424. package/src/browser/mcp/tools/editFile.ts +0 -100
  425. package/src/browser/mcp/tools/fileSearch.ts +0 -99
  426. package/src/browser/mcp/tools/getDiagnosticsByPath.ts +0 -122
  427. package/src/browser/mcp/tools/getOpenEditorFileDiagnostics.ts +0 -120
  428. package/src/browser/mcp/tools/grepSearch.ts +0 -121
  429. package/src/browser/mcp/tools/handlers/EditFile.ts +0 -21
  430. package/src/browser/mcp/tools/handlers/ListDir.ts +0 -117
  431. package/src/browser/mcp/tools/handlers/ReadFile.ts +0 -192
  432. package/src/browser/mcp/tools/handlers/RunCommand.ts +0 -115
  433. package/src/browser/mcp/tools/handlers/utils.ts +0 -3
  434. package/src/browser/mcp/tools/listDir.ts +0 -65
  435. package/src/browser/mcp/tools/readFile.ts +0 -81
  436. package/src/browser/mcp/tools/runTerminalCmd.ts +0 -45
  437. package/src/browser/widget/inline-input/model.ts +0 -74
  438. package/src/common/llm-context.ts +0 -47
  439. package/src/common/mcp-server-manager.ts +0 -51
  440. package/src/common/prompts/context-prompt-provider.ts +0 -46
  441. package/src/common/tool-invocation-registry.ts +0 -168
  442. package/src/node/anthropic/anthropic-language-model.ts +0 -25
  443. package/src/node/base-language-model.ts +0 -177
  444. package/src/node/deepseek/deepseek-language-model.ts +0 -25
  445. package/src/node/mcp/sumi-mcp-server.ts +0 -200
  446. package/src/node/mcp-server-manager-impl.ts +0 -156
  447. package/src/node/mcp-server.ts +0 -127
  448. package/src/node/openai/openai-language-model.ts +0 -25
@@ -15,7 +15,6 @@ import {
15
15
  Disposable,
16
16
  ErrorResponse,
17
17
  Event,
18
- FRAME_THREE,
19
18
  IAIReporter,
20
19
  IDisposable,
21
20
  ILogServiceClient,
@@ -31,14 +30,14 @@ import * as monaco from '@opensumi/ide-monaco';
31
30
  import { ICodeEditor } from '@opensumi/ide-monaco';
32
31
  import { monacoApi } from '@opensumi/ide-monaco/lib/browser/monaco-api';
33
32
 
34
- import { AINativeContextKey } from '../../ai-core.contextkeys';
35
33
  import { BaseAIMonacoEditorController } from '../../contrib/base';
36
34
  import { CodeActionService } from '../../contrib/code-action/code-action.service';
35
+ import { ERunStrategy } from '../../types';
37
36
  import { InlineDiffController } from '../inline-diff/inline-diff.controller';
38
37
 
39
38
  import { InlineChatController } from './inline-chat-controller';
40
39
  import { InlineChatFeatureRegistry } from './inline-chat.feature.registry';
41
- import { EInlineChatStatus, EResultKind, InlineChatService } from './inline-chat.service';
40
+ import { AIInlineChatService, EInlineChatStatus, EResultKind } from './inline-chat.service';
42
41
  import { AIInlineContentWidget } from './inline-content-widget';
43
42
 
44
43
  export class InlineChatEditorController extends BaseAIMonacoEditorController {
@@ -52,7 +51,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
52
51
  return this.injector.get(AINativeConfigService);
53
52
  }
54
53
 
55
- private get aiInlineChatService(): InlineChatService {
54
+ private get aiInlineChatService(): AIInlineChatService {
56
55
  return this.injector.get(IAIInlineChatService);
57
56
  }
58
57
 
@@ -87,13 +86,11 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
87
86
  private aiInlineContentWidget: AIInlineContentWidget;
88
87
  private aiInlineChatDisposable: Disposable = new Disposable();
89
88
  private aiInlineChatOperationDisposable: Disposable = new Disposable();
90
- private aiNativeContextKey: AINativeContextKey;
91
89
  private inlineChatInUsing = false;
92
90
 
93
91
  private inlineDiffController: InlineDiffController;
94
92
 
95
93
  mount(): IDisposable {
96
- this.aiNativeContextKey = this.injector.get(AINativeContextKey, [this.monacoEditor.contextKeyService]);
97
94
  this.inlineDiffController = InlineDiffController.get(this.monacoEditor)!;
98
95
 
99
96
  if (!this.monacoEditor) {
@@ -181,7 +178,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
181
178
  Event.debounce(
182
179
  Event.any<any>(this.monacoEditor.onDidChangeCursorSelection, this.monacoEditor.onMouseUp),
183
180
  (_, e) => e,
184
- FRAME_THREE,
181
+ 100,
185
182
  )(() => {
186
183
  if (!prefInlineChatAutoVisible || !needShowInlineChat) {
187
184
  return;
@@ -200,7 +197,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
200
197
  return this.featureDisposable;
201
198
  }
202
199
 
203
- public disposeAllWidget() {
200
+ private disposeAllWidget() {
204
201
  [this.aiInlineContentWidget, this.aiInlineChatDisposable, this.aiInlineChatOperationDisposable].forEach(
205
202
  (widget) => {
206
203
  widget?.dispose();
@@ -222,26 +219,14 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
222
219
 
223
220
  protected async showInlineChat(monacoEditor: monaco.ICodeEditor): Promise<void> {
224
221
  // 调试状态下禁用 inline chat。影响调试体验
225
- const inDebugMode = this.contextKeyService.getContextKeyValue(CONTEXT_IN_DEBUG_MODE_KEY);
222
+ const inDebugMode = this.contextKeyService.getContextValue(CONTEXT_IN_DEBUG_MODE_KEY);
226
223
  if (inDebugMode) {
227
224
  return;
228
225
  }
229
226
 
230
- // 如果 inline input 正在展示,则不展示 inline chat
231
- const isInlineInputVisible = this.aiNativeContextKey.inlineInputWidgetIsVisible.get();
232
- if (isInlineInputVisible) {
233
- return;
234
- }
235
-
236
- const isInlineStreaming = this.aiNativeContextKey.inlineInputWidgetIsStreaming.get();
237
- if (isInlineStreaming) {
238
- return;
239
- }
240
-
241
227
  if (!this.aiNativeConfigService.capabilities.supportsInlineChat) {
242
228
  return;
243
229
  }
244
-
245
230
  if (this.inlineChatInUsing) {
246
231
  return;
247
232
  }
@@ -258,6 +243,12 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
258
243
 
259
244
  this.showInlineContentWidget(monacoEditor, selection);
260
245
 
246
+ this.aiInlineChatDisposable.addDispose(
247
+ this.inlineChatFeatureRegistry.onChatClick(() => {
248
+ this.aiInlineChatService.launchInputVisible(true);
249
+ }),
250
+ );
251
+
261
252
  this.aiInlineChatDisposable.addDispose(
262
253
  this.aiInlineContentWidget.onActionClick(({ actionId, source }) => {
263
254
  const handler = this.inlineChatFeatureRegistry.getEditorHandler(actionId);
@@ -280,7 +271,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
280
271
  return undefined;
281
272
  }
282
273
 
283
- return strategy.bind(this, monacoEditor, crossSelection, this.token);
274
+ return strategy.bind(this, monacoEditor, this.token);
284
275
  };
285
276
 
286
277
  this.runAction({
@@ -297,7 +288,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
297
288
  });
298
289
  return relationId;
299
290
  },
300
- execute: handler.execute ? handler.execute!.bind(this, monacoEditor, crossSelection, this.token) : undefined,
291
+ execute: handler.execute ? handler.execute!.bind(this, monacoEditor, this.token) : undefined,
301
292
  providerPreview: previewer(),
302
293
  extraData: {
303
294
  actionSource: source === 'codeAction' ? ActionSourceEnum.CodeAction : ActionSourceEnum.InlineChat,
@@ -306,6 +297,49 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
306
297
  });
307
298
  }),
308
299
  );
300
+
301
+ this.aiInlineChatDisposable.addDispose(
302
+ this.aiInlineContentWidget.onInteractiveInputValue(async (value) => {
303
+ const handler = this.inlineChatFeatureRegistry.getInteractiveInputHandler();
304
+
305
+ if (!handler) {
306
+ return;
307
+ }
308
+
309
+ const strategy = await this.inlineChatFeatureRegistry.getInteractiveInputStrategyHandler()(monacoEditor, value);
310
+
311
+ const crossSelection = this.getCrossSelection(monacoEditor);
312
+ if (!crossSelection) {
313
+ return;
314
+ }
315
+
316
+ this.runAction({
317
+ monacoEditor,
318
+ crossSelection,
319
+ reporterFn: () => {
320
+ const relationId = this.aiReporter.start(AIServiceType.InlineChatInput, {
321
+ message: value,
322
+ type: AIServiceType.InlineChatInput,
323
+ source: 'input',
324
+ actionSource: ActionSourceEnum.InlineChatInput,
325
+ });
326
+ return relationId;
327
+ },
328
+ execute:
329
+ handler.execute && strategy === ERunStrategy.EXECUTE
330
+ ? handler.execute!.bind(this, monacoEditor, value, this.token)
331
+ : undefined,
332
+ providerPreview:
333
+ handler.providePreviewStrategy && strategy === ERunStrategy.PREVIEW
334
+ ? handler.providePreviewStrategy.bind(this, monacoEditor, value, this.token)
335
+ : undefined,
336
+ extraData: {
337
+ actionSource: ActionSourceEnum.InlineChatInput,
338
+ actionType: strategy,
339
+ },
340
+ });
341
+ }),
342
+ );
309
343
  }
310
344
 
311
345
  private getCrossSelection(monacoEditor: monaco.ICodeEditor) {
@@ -446,7 +480,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
446
480
  }
447
481
 
448
482
  const diffPreviewer = this.inlineDiffController.showPreviewerByStream(monacoEditor, options);
449
- diffPreviewer.mountWidget(this.aiInlineContentWidget);
483
+ diffPreviewer.mount(this.aiInlineContentWidget);
450
484
  }
451
485
 
452
486
  private ensureInlineChatVisible(monacoEditor: monaco.ICodeEditor, crossSelection: monaco.Selection) {
@@ -472,6 +506,7 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
472
506
  const { monacoEditor, strategy, crossSelection, relationId, isRetry, actionType, actionSource } = params;
473
507
  const model = monacoEditor.getModel();
474
508
 
509
+ this.inlineDiffController.destroyPreviewer(model!.uri.toString());
475
510
  this.aiInlineChatOperationDisposable.dispose();
476
511
 
477
512
  this.ensureInlineChatVisible(monacoEditor, crossSelection);
@@ -508,6 +543,12 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
508
543
  return;
509
544
  }
510
545
 
546
+ this.visibleDiffWidget({
547
+ monacoEditor,
548
+ options: { crossSelection, chatResponse: response },
549
+ reportInfo: { relationId, startTime, isRetry, actionType, actionSource },
550
+ });
551
+
511
552
  this.aiInlineChatOperationDisposable.addDispose([
512
553
  this.aiInlineContentWidget.onResultClick((kind: EResultKind) => {
513
554
  const modifyContent = this.inlineDiffController.getModifyContent();
@@ -573,12 +614,6 @@ export class InlineChatEditorController extends BaseAIMonacoEditorController {
573
614
  });
574
615
  }),
575
616
  ]);
576
-
577
- this.visibleDiffWidget({
578
- monacoEditor,
579
- options: { crossSelection, chatResponse: response },
580
- reportInfo: { relationId, startTime, isRetry, actionType, actionSource },
581
- });
582
617
  }
583
618
 
584
619
  public async runAction(params: {
@@ -2,18 +2,48 @@ import { Autowired, Injectable } from '@opensumi/di';
2
2
  import { KeybindingRegistry, Logger } from '@opensumi/ide-core-browser';
3
3
  import { AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE } from '@opensumi/ide-core-browser/lib/ai-native/command';
4
4
  import { AIActionItem } from '@opensumi/ide-core-browser/lib/components/ai-native';
5
- import { Disposable, Event, IDisposable, formatLocalize, isUndefined } from '@opensumi/ide-core-common';
5
+ import { InteractiveInput } from '@opensumi/ide-core-browser/lib/components/ai-native/interactive-input/index';
6
+ import { Disposable, Emitter, Event, IDisposable, MaybePromise, isUndefined, uuid } from '@opensumi/ide-core-common';
7
+ import { ICodeEditor } from '@opensumi/ide-monaco';
6
8
 
7
9
  import { CodeActionService } from '../../contrib/code-action/code-action.service';
8
10
  import {
11
+ ERunStrategy,
9
12
  IEditorInlineChatHandler,
10
13
  IInlineChatFeatureRegistry,
11
14
  IInteractiveInputHandler,
12
15
  IInteractiveInputRunStrategy,
13
16
  ITerminalInlineChatHandler,
14
17
  } from '../../types';
15
- import { InlineInputService } from '../inline-input/inline-input.service';
16
- import { InteractiveInputModel } from '../inline-input/model';
18
+
19
+ type TRunStrategyFn = (editor: ICodeEditor, value: string) => MaybePromise<ERunStrategy>;
20
+
21
+ class InteractiveInputModel {
22
+ static ID: string = `${InteractiveInput.displayName}:${uuid(4)}`;
23
+
24
+ private _handler: IInteractiveInputHandler | undefined;
25
+ private _strategyHandler: TRunStrategyFn;
26
+
27
+ public setHandler(h: IInteractiveInputHandler): void {
28
+ this._handler = h;
29
+ }
30
+
31
+ public handler(): IInteractiveInputHandler | undefined {
32
+ return this._handler;
33
+ }
34
+
35
+ public setStrategyHandler(fn: TRunStrategyFn): void {
36
+ this._strategyHandler = fn;
37
+ }
38
+
39
+ public strategyHandler(): TRunStrategyFn {
40
+ return this._strategyHandler;
41
+ }
42
+
43
+ public dispose(): void {
44
+ this._handler = undefined;
45
+ }
46
+ }
17
47
 
18
48
  @Injectable()
19
49
  export class InlineChatFeatureRegistry extends Disposable implements IInlineChatFeatureRegistry {
@@ -23,9 +53,6 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
23
53
  @Autowired(CodeActionService)
24
54
  private readonly codeActionService: CodeActionService;
25
55
 
26
- @Autowired(InlineInputService)
27
- private readonly inlineInputService: InlineInputService;
28
-
29
56
  @Autowired(KeybindingRegistry)
30
57
  private readonly keybindingRegistry: KeybindingRegistry;
31
58
 
@@ -33,6 +60,11 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
33
60
  private editorHandlerMap: Map<string, IEditorInlineChatHandler> = new Map();
34
61
  private terminalHandlerMap: Map<string, ITerminalInlineChatHandler> = new Map();
35
62
 
63
+ private interactiveInputModel: InteractiveInputModel = new InteractiveInputModel();
64
+
65
+ public readonly _onChatClick = new Emitter<void>();
66
+ public readonly onChatClick: Event<void> = this._onChatClick.event;
67
+
36
68
  override dispose() {
37
69
  super.dispose();
38
70
  this.actionsMap.clear();
@@ -40,6 +72,10 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
40
72
  this.terminalHandlerMap.clear();
41
73
  }
42
74
 
75
+ private updateActions(id: string, operational: AIActionItem): void {
76
+ this.actionsMap.set(id, operational);
77
+ }
78
+
43
79
  private collectActions(operational: AIActionItem): boolean {
44
80
  const { id } = operational;
45
81
 
@@ -66,6 +102,10 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
66
102
  this.codeActionService.deleteCodeActionById(operational.id);
67
103
  }
68
104
 
105
+ public getInteractiveInputId(): string {
106
+ return InteractiveInputModel.ID;
107
+ }
108
+
69
109
  public registerEditorInlineChat(operational: AIActionItem, handler: IEditorInlineChatHandler): IDisposable {
70
110
  const isCollect = this.collectActions(operational);
71
111
 
@@ -111,23 +151,29 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
111
151
  runStrategy: IInteractiveInputRunStrategy,
112
152
  handler: IInteractiveInputHandler,
113
153
  ): IDisposable {
114
- const doCollect = () => {
115
- const keybindingStr = String(this.inlineInputService.getSequenceKeyString());
116
- if (!keybindingStr) {
117
- return;
118
- }
154
+ this.interactiveInputModel.setHandler(handler);
119
155
 
120
- const operational: AIActionItem = {
121
- id: InteractiveInputModel.ID,
122
- name: formatLocalize('aiNative.inline.chat.operate.chat.title', keybindingStr.toLocaleUpperCase()),
123
- renderType: 'button',
124
- order: Number.MAX_SAFE_INTEGER,
125
- };
126
-
127
- if (this.actionsMap.has(operational.id)) {
128
- this.actionsMap.set(operational.id, operational);
129
- } else {
130
- this.collectActions(operational);
156
+ if (runStrategy.handleStrategy) {
157
+ this.interactiveInputModel.setStrategyHandler(runStrategy.handleStrategy);
158
+ } else {
159
+ this.interactiveInputModel.setStrategyHandler(() => runStrategy.strategy || ERunStrategy.EXECUTE);
160
+ }
161
+
162
+ const doCollect = () => {
163
+ const keybindingStr = String(this.getSequenceKeyString());
164
+ if (keybindingStr) {
165
+ const operational: AIActionItem = {
166
+ id: InteractiveInputModel.ID,
167
+ name: `Chat(${keybindingStr.toLocaleUpperCase()})`,
168
+ renderType: 'button',
169
+ order: Number.MAX_SAFE_INTEGER,
170
+ };
171
+
172
+ if (this.actionsMap.has(operational.id)) {
173
+ this.updateActions(operational.id, operational);
174
+ } else {
175
+ this.collectActions(operational);
176
+ }
131
177
  }
132
178
  };
133
179
 
@@ -139,7 +185,28 @@ export class InlineChatFeatureRegistry extends Disposable implements IInlineChat
139
185
 
140
186
  doCollect();
141
187
 
142
- return this.inlineInputService.registerInlineInput(runStrategy, handler);
188
+ return {
189
+ dispose: () => {
190
+ this.interactiveInputModel.dispose();
191
+ },
192
+ };
193
+ }
194
+
195
+ private getSequenceKeyString() {
196
+ const keybindings = this.keybindingRegistry.getKeybindingsForCommand(AI_INLINE_CHAT_INTERACTIVE_INPUT_VISIBLE.id);
197
+ const resolved = keybindings[0]?.resolved;
198
+ if (!resolved) {
199
+ return '';
200
+ }
201
+ return this.keybindingRegistry.acceleratorForSequence(resolved, '+');
202
+ }
203
+
204
+ public getInteractiveInputHandler(): IInteractiveInputHandler | undefined {
205
+ return this.interactiveInputModel.handler();
206
+ }
207
+
208
+ public getInteractiveInputStrategyHandler(): TRunStrategyFn {
209
+ return this.interactiveInputModel.strategyHandler();
143
210
  }
144
211
 
145
212
  public getEditorActionButtons(): AIActionItem[] {
@@ -1,11 +1,19 @@
1
1
  import { Injectable } from '@opensumi/di';
2
2
  import { IAIInlineChatService } from '@opensumi/ide-core-browser';
3
- import { Emitter, Event } from '@opensumi/ide-core-common';
3
+ import { Emitter, Event, runWhenIdle } from '@opensumi/ide-core-common';
4
4
 
5
5
  export { EInlineChatStatus, EResultKind } from '../../../common';
6
6
 
7
7
  @Injectable({ multiple: false })
8
- export class InlineChatService implements IAIInlineChatService {
8
+ export class AIInlineChatService implements IAIInlineChatService {
9
+ private _interactiveInputVisible: boolean = false;
10
+ public get interactiveInputVisible(): boolean {
11
+ return this._interactiveInputVisible;
12
+ }
13
+
14
+ public readonly _onInteractiveInputVisible = new Emitter<boolean>();
15
+ public readonly onInteractiveInputVisible: Event<boolean> = this._onInteractiveInputVisible.event;
16
+
9
17
  public readonly _onInlineChatVisible = new Emitter<boolean>();
10
18
  public readonly onInlineChatVisible: Event<boolean> = this._onInlineChatVisible.event;
11
19
 
@@ -15,4 +23,11 @@ export class InlineChatService implements IAIInlineChatService {
15
23
  public fireThumbsEvent(isThumbsUp: boolean) {
16
24
  this._onThumbs.fire(isThumbsUp);
17
25
  }
26
+
27
+ public launchInputVisible(v: boolean) {
28
+ return runWhenIdle(() => {
29
+ this._interactiveInputVisible = v;
30
+ this._onInteractiveInputVisible.fire(v);
31
+ });
32
+ }
18
33
  }
@@ -3,6 +3,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
3
3
  import { Autowired, INJECTOR_TOKEN, Injectable, Injector } from '@opensumi/di';
4
4
  import { IAIInlineChatService, StackingLevel, useInjectable } from '@opensumi/ide-core-browser';
5
5
  import { AIAction } from '@opensumi/ide-core-browser/lib/components/ai-native';
6
+ import { InteractiveInput } from '@opensumi/ide-core-browser/lib/components/ai-native/interactive-input/index';
6
7
  import { MenuNode } from '@opensumi/ide-core-browser/lib/menu/next/base';
7
8
  import {
8
9
  AIInlineChatContentWidgetId,
@@ -10,6 +11,7 @@ import {
10
11
  Emitter,
11
12
  Event,
12
13
  InlineChatFeatureRegistryToken,
14
+ localize,
13
15
  runWhenIdle,
14
16
  } from '@opensumi/ide-core-common';
15
17
  import * as monaco from '@opensumi/ide-monaco';
@@ -21,32 +23,38 @@ import {
21
23
 
22
24
  import { AINativeContextKey } from '../../ai-core.contextkeys';
23
25
  import { InlineResultAction } from '../inline-actions/result-items/index';
24
- import { InlineInputService } from '../inline-input/inline-input.service';
25
- import { InteractiveInputModel } from '../inline-input/model';
26
26
 
27
27
  import { InlineChatFeatureRegistry } from './inline-chat.feature.registry';
28
28
  import styles from './inline-chat.module.less';
29
- import { EInlineChatStatus, EResultKind, InlineChatService } from './inline-chat.service';
29
+ import { AIInlineChatService, EInlineChatStatus, EResultKind } from './inline-chat.service';
30
30
 
31
31
  import type { ICodeEditor as IMonacoCodeEditor } from '@opensumi/ide-monaco/lib/browser/monaco-api/types';
32
32
 
33
33
  interface IAIInlineChatControllerProps {
34
34
  onClickActions: (id: string) => void;
35
+ onLayoutChange: (height: number) => void;
35
36
  onClose?: () => void;
37
+ onInteractiveInputSend?: (value: string) => void;
36
38
  onChatStatus: Event<EInlineChatStatus>;
37
39
  onResultClick: (k: EResultKind) => void;
38
40
  }
39
41
 
40
42
  const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
41
- const { onClickActions, onClose, onChatStatus, onResultClick } = props;
42
- const aiInlineChatService: InlineChatService = useInjectable(IAIInlineChatService);
43
+ const { onClickActions, onClose, onInteractiveInputSend, onLayoutChange, onChatStatus, onResultClick } = props;
44
+ const aiInlineChatService: AIInlineChatService = useInjectable(IAIInlineChatService);
43
45
  const inlineChatFeatureRegistry: InlineChatFeatureRegistry = useInjectable(InlineChatFeatureRegistryToken);
44
-
45
46
  const [status, setStatus] = useState<EInlineChatStatus>(EInlineChatStatus.READY);
47
+ const [interactiveInputVisible, setInteractiveInputVisible] = useState<boolean>(false);
46
48
  useEffect(() => {
47
49
  const dis = new Disposable();
48
50
  dis.addDispose(onChatStatus((s) => setStatus(s)));
49
51
 
52
+ dis.addDispose(
53
+ aiInlineChatService.onInteractiveInputVisible((v) => {
54
+ setInteractiveInputVisible(v);
55
+ }),
56
+ );
57
+
50
58
  return () => {
51
59
  dis.dispose();
52
60
  };
@@ -74,6 +82,13 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
74
82
  onClose?.();
75
83
  }, [onClose]);
76
84
 
85
+ const handleInteractiveInputSend = useCallback(
86
+ (value: string) => {
87
+ onInteractiveInputSend?.(value);
88
+ },
89
+ [onInteractiveInputSend],
90
+ );
91
+
77
92
  const moreOperation = useMemo(
78
93
  () =>
79
94
  inlineChatFeatureRegistry.getEditorActionMenus().map(
@@ -90,6 +105,24 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
90
105
  [inlineChatFeatureRegistry],
91
106
  );
92
107
 
108
+ const customOperationRender = useMemo(() => {
109
+ if (!interactiveInputVisible) {
110
+ return null;
111
+ }
112
+
113
+ return (
114
+ <InteractiveInput
115
+ autoFocus
116
+ onHeightChange={(height) => onLayoutChange(height)}
117
+ size='small'
118
+ placeholder={localize('aiNative.inline.chat.input.placeholder.default')}
119
+ width={320}
120
+ disabled={isLoading}
121
+ onSend={handleInteractiveInputSend}
122
+ />
123
+ );
124
+ }, [isLoading, interactiveInputVisible]);
125
+
93
126
  const renderContent = useCallback(() => {
94
127
  if (operationList.length === 0 && moreOperation.length === 0) {
95
128
  return null;
@@ -110,9 +143,11 @@ const AIInlineChatController = (props: IAIInlineChatControllerProps) => {
110
143
  onClickItem={handleClickActions}
111
144
  onClose={handleClose}
112
145
  loading={isLoading}
146
+ loadingShowOperation={interactiveInputVisible}
147
+ customOperationRender={customOperationRender}
113
148
  />
114
149
  );
115
- }, [operationList, moreOperation, onResultClick, status]);
150
+ }, [operationList, moreOperation, customOperationRender, onResultClick, status, interactiveInputVisible]);
116
151
 
117
152
  return <div className={styles.inline_chat_controller_box}>{renderContent()}</div>;
118
153
  };
@@ -124,20 +159,28 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
124
159
  @Autowired(INJECTOR_TOKEN)
125
160
  private readonly injector: Injector;
126
161
 
127
- @Autowired(InlineInputService)
128
- protected readonly inlineInputService: InlineInputService;
162
+ @Autowired(InlineChatFeatureRegistryToken)
163
+ private readonly inlineChatFeatureRegistry: InlineChatFeatureRegistry;
129
164
 
130
165
  private readonly aiNativeContextKey: AINativeContextKey;
131
166
 
132
167
  private readonly _onActionClickEmitter = new Emitter<{ actionId: string; source: string }>();
133
168
  public readonly onActionClick = this._onActionClickEmitter.event;
134
169
 
170
+ protected readonly _onInteractiveInputValue = new Emitter<string>();
171
+ public readonly onInteractiveInputValue = this._onInteractiveInputValue.event;
172
+
135
173
  protected readonly _onStatusChange = new Emitter<EInlineChatStatus>();
136
174
  public readonly onStatusChange: Event<EInlineChatStatus> = this._onStatusChange.event;
137
175
 
138
176
  protected readonly _onResultClick = new Emitter<EResultKind>();
139
177
  public readonly onResultClick: Event<EResultKind> = this._onResultClick.event;
140
178
 
179
+ protected _interactiveInputValue: string;
180
+ public get interactiveInputValue(): string {
181
+ return this._interactiveInputValue;
182
+ }
183
+
141
184
  protected _status: EInlineChatStatus = EInlineChatStatus.READY;
142
185
  public get status(): EInlineChatStatus {
143
186
  return this._status;
@@ -151,6 +194,13 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
151
194
  super(editor);
152
195
 
153
196
  this.aiNativeContextKey = this.injector.get(AINativeContextKey, [this.editor.contextKeyService]);
197
+ this.addDispose(
198
+ this.editor.onDidLayoutChange(() => {
199
+ if (this.isOutOfArea()) {
200
+ this.dispose();
201
+ }
202
+ }),
203
+ );
154
204
  }
155
205
 
156
206
  public launchChatStatus(status: EInlineChatStatus) {
@@ -166,11 +216,8 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
166
216
  }
167
217
 
168
218
  public clickActionId(actionId: string, source: string): void {
169
- if (actionId === InteractiveInputModel.ID && this.options?.selection) {
170
- // 隐藏当前的 inline chat widget
171
- this.hide();
172
- // 显示 inline input widget
173
- this.inlineInputService.visibleBySelection(this.options.selection);
219
+ if (actionId === this.inlineChatFeatureRegistry.getInteractiveInputId()) {
220
+ this.inlineChatFeatureRegistry._onChatClick.fire();
174
221
  return;
175
222
  }
176
223
 
@@ -183,6 +230,14 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
183
230
  onClickActions={(id) => this.clickActionId(id, 'widget')}
184
231
  onClose={() => this.dispose()}
185
232
  onChatStatus={this.onStatusChange.bind(this)}
233
+ onLayoutChange={() => {
234
+ this.editor.layoutContentWidget(this);
235
+ }}
236
+ onInteractiveInputSend={(value) => {
237
+ this.launchChatStatus(EInlineChatStatus.THINKING);
238
+ this._interactiveInputValue = value;
239
+ this._onInteractiveInputValue.fire(value);
240
+ }}
186
241
  onResultClick={(kind: EResultKind) => {
187
242
  this._onResultClick.fire(kind);
188
243
  }}