@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.
- package/lib/browser/ai-core.contextkeys.d.ts +0 -1
- package/lib/browser/ai-core.contextkeys.d.ts.map +1 -1
- package/lib/browser/ai-core.contextkeys.js +0 -1
- package/lib/browser/ai-core.contextkeys.js.map +1 -1
- package/lib/browser/ai-core.contribution.d.ts +2 -8
- package/lib/browser/ai-core.contribution.d.ts.map +1 -1
- package/lib/browser/ai-core.contribution.js +20 -149
- package/lib/browser/ai-core.contribution.js.map +1 -1
- package/lib/browser/chat/chat-agent.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-agent.service.js +0 -6
- package/lib/browser/chat/chat-agent.service.js.map +1 -1
- package/lib/browser/chat/chat-manager.service.d.ts +2 -30
- package/lib/browser/chat/chat-manager.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-manager.service.js +1 -45
- package/lib/browser/chat/chat-manager.service.js.map +1 -1
- package/lib/browser/chat/chat-model.d.ts +7 -34
- package/lib/browser/chat/chat-model.d.ts.map +1 -1
- package/lib/browser/chat/chat-model.js +57 -71
- package/lib/browser/chat/chat-model.js.map +1 -1
- package/lib/browser/chat/chat-proxy.service.d.ts +1 -6
- package/lib/browser/chat/chat-proxy.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-proxy.service.js +3 -54
- package/lib/browser/chat/chat-proxy.service.js.map +1 -1
- package/lib/browser/chat/chat.api.service.d.ts +1 -1
- package/lib/browser/chat/chat.api.service.d.ts.map +1 -1
- package/lib/browser/chat/chat.api.service.js +2 -2
- package/lib/browser/chat/chat.api.service.js.map +1 -1
- package/lib/browser/chat/chat.internal.service.d.ts +2 -8
- package/lib/browser/chat/chat.internal.service.d.ts.map +1 -1
- package/lib/browser/chat/chat.internal.service.js +13 -41
- package/lib/browser/chat/chat.internal.service.js.map +1 -1
- package/lib/browser/chat/chat.module.less +41 -17
- package/lib/browser/chat/chat.view.d.ts.map +1 -1
- package/lib/browser/chat/chat.view.js +14 -102
- package/lib/browser/chat/chat.view.js.map +1 -1
- package/lib/browser/components/ChatEditor.d.ts +0 -1
- package/lib/browser/components/ChatEditor.d.ts.map +1 -1
- package/lib/browser/components/ChatEditor.js +3 -3
- package/lib/browser/components/ChatEditor.js.map +1 -1
- package/lib/browser/components/ChatInput.d.ts.map +1 -1
- package/lib/browser/components/ChatInput.js.map +1 -1
- package/lib/browser/components/ChatMarkdown.d.ts +0 -1
- package/lib/browser/components/ChatMarkdown.d.ts.map +1 -1
- package/lib/browser/components/ChatMarkdown.js +2 -2
- package/lib/browser/components/ChatMarkdown.js.map +1 -1
- package/lib/browser/components/ChatReply.d.ts.map +1 -1
- package/lib/browser/components/ChatReply.js +4 -29
- package/lib/browser/components/ChatReply.js.map +1 -1
- package/lib/browser/components/ChatThinking.js +1 -1
- package/lib/browser/components/ChatThinking.js.map +1 -1
- package/lib/browser/components/WelcomeMsg.js.map +1 -1
- package/lib/browser/components/components.module.less +31 -33
- package/lib/browser/components/utils.d.ts +2 -2
- package/lib/browser/contrib/intelligent-completions/index.d.ts +9 -16
- package/lib/browser/contrib/intelligent-completions/index.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/index.js +1 -6
- package/lib/browser/contrib/intelligent-completions/index.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts +0 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js +4 -26
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.contribution.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts +5 -5
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js +48 -59
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.controller.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.d.ts +0 -4
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.js +0 -7
- package/lib/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/base.d.ts +5 -14
- package/lib/browser/contrib/intelligent-completions/source/base.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/base.js +8 -29
- package/lib/browser/contrib/intelligent-completions/source/base.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts +3 -10
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.js +22 -95
- package/lib/browser/contrib/intelligent-completions/source/line-change.source.js.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts +3 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js +20 -13
- package/lib/browser/contrib/intelligent-completions/source/lint-error.source.js.map +1 -1
- package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js +2 -2
- package/lib/browser/contrib/terminal/component/terminal-command-suggest-controller.js.map +1 -1
- package/lib/browser/index.d.ts +3 -11
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +4 -56
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/languages/tree-sitter/wasm-manager.d.ts.map +1 -1
- package/lib/browser/languages/tree-sitter/wasm-manager.js +2 -14
- package/lib/browser/languages/tree-sitter/wasm-manager.js.map +1 -1
- package/lib/browser/layout/ai-layout.d.ts.map +1 -1
- package/lib/browser/layout/ai-layout.js +2 -2
- package/lib/browser/layout/ai-layout.js.map +1 -1
- package/lib/browser/layout/layout.module.less +9 -9
- package/lib/browser/layout/tabbar.view.d.ts.map +1 -1
- package/lib/browser/layout/tabbar.view.js +6 -5
- package/lib/browser/layout/tabbar.view.js.map +1 -1
- package/lib/browser/model/enhanceDecorationsCollection.d.ts +10 -14
- package/lib/browser/model/enhanceDecorationsCollection.d.ts.map +1 -1
- package/lib/browser/model/enhanceDecorationsCollection.js +53 -42
- package/lib/browser/model/enhanceDecorationsCollection.js.map +1 -1
- package/lib/browser/model/msg-history-manager.d.ts +1 -20
- package/lib/browser/model/msg-history-manager.d.ts.map +1 -1
- package/lib/browser/model/msg-history-manager.js +10 -46
- package/lib/browser/model/msg-history-manager.js.map +1 -1
- package/lib/browser/model/styles.module.less +7 -0
- package/lib/browser/preferences/schema.d.ts.map +1 -1
- package/lib/browser/preferences/schema.js +0 -69
- package/lib/browser/preferences/schema.js.map +1 -1
- package/lib/browser/types.d.ts +4 -74
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/types.js +1 -4
- package/lib/browser/types.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts +1 -2
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js +49 -21
- package/lib/browser/widget/inline-chat/inline-chat-editor.controller.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts +13 -3
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js +72 -24
- package/lib/browser/widget/inline-chat/inline-chat.feature.registry.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.d.ts +6 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-chat.service.js +17 -5
- package/lib/browser/widget/inline-chat/inline-chat.service.js.map +1 -1
- package/lib/browser/widget/inline-chat/inline-content-widget.d.ts +5 -2
- package/lib/browser/widget/inline-chat/inline-content-widget.d.ts.map +1 -1
- package/lib/browser/widget/inline-chat/inline-content-widget.js +42 -17
- package/lib/browser/widget/inline-chat/inline-content-widget.js.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts +5 -22
- package/lib/browser/widget/inline-diff/inline-diff-previewer.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-previewer.js +30 -61
- package/lib/browser/widget/inline-diff/inline-diff-previewer.js.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts +12 -8
- package/lib/browser/widget/inline-diff/inline-diff.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff.controller.js +96 -68
- package/lib/browser/widget/inline-diff/inline-diff.controller.js.map +1 -1
- package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts +1 -0
- package/lib/browser/widget/inline-hint/inline-hint.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-hint/inline-hint.controller.js +5 -0
- package/lib/browser/widget/inline-hint/inline-hint.controller.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input-widget.d.ts +2 -12
- package/lib/browser/widget/inline-input/inline-input-widget.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input-widget.js +18 -26
- package/lib/browser/widget/inline-input/inline-input-widget.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.controller.d.ts +5 -14
- package/lib/browser/widget/inline-input/inline-input.controller.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.controller.js +165 -321
- package/lib/browser/widget/inline-input/inline-input.controller.js.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.module.less +0 -4
- package/lib/browser/widget/inline-input/inline-input.service.d.ts +7 -19
- package/lib/browser/widget/inline-input/inline-input.service.d.ts.map +1 -1
- package/lib/browser/widget/inline-input/inline-input.service.js +12 -72
- package/lib/browser/widget/inline-input/inline-input.service.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts +19 -9
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js +39 -47
- package/lib/browser/widget/inline-stream-diff/inline-stream-diff.handler.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts +4 -21
- package/lib/browser/widget/inline-stream-diff/live-preview.component.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.component.js +5 -37
- package/lib/browser/widget/inline-stream-diff/live-preview.component.js.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts +11 -7
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.d.ts.map +1 -1
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js +77 -34
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js.map +1 -1
- package/lib/common/index.d.ts +0 -10
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -4
- package/lib/common/index.js.map +1 -1
- package/lib/common/types.d.ts +0 -17
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/utils.d.ts +0 -1
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +3 -5
- package/lib/common/utils.js.map +1 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +0 -19
- package/lib/node/index.js.map +1 -1
- package/package.json +22 -33
- package/src/browser/ai-core.contextkeys.ts +0 -3
- package/src/browser/ai-core.contribution.ts +21 -167
- package/src/browser/chat/chat-agent.service.ts +0 -7
- package/src/browser/chat/chat-manager.service.ts +7 -83
- package/src/browser/chat/chat-model.ts +20 -86
- package/src/browser/chat/chat-proxy.service.ts +3 -55
- package/src/browser/chat/chat.api.service.ts +2 -2
- package/src/browser/chat/chat.internal.service.ts +6 -35
- package/src/browser/chat/chat.module.less +41 -17
- package/src/browser/chat/chat.view.tsx +45 -191
- package/src/browser/components/ChatEditor.tsx +10 -13
- package/src/browser/components/ChatInput.tsx +0 -1
- package/src/browser/components/ChatMarkdown.tsx +2 -4
- package/src/browser/components/ChatReply.tsx +9 -38
- package/src/browser/components/ChatThinking.tsx +1 -1
- package/src/browser/components/WelcomeMsg.tsx +1 -1
- package/src/browser/components/components.module.less +31 -33
- package/src/browser/contrib/intelligent-completions/index.ts +4 -19
- package/src/browser/contrib/intelligent-completions/intelligent-completions.contribution.ts +8 -32
- package/src/browser/contrib/intelligent-completions/intelligent-completions.controller.ts +67 -102
- package/src/browser/contrib/intelligent-completions/intelligent-completions.feature.registry.ts +0 -11
- package/src/browser/contrib/intelligent-completions/source/base.ts +14 -39
- package/src/browser/contrib/intelligent-completions/source/line-change.source.ts +22 -129
- package/src/browser/contrib/intelligent-completions/source/lint-error.source.ts +31 -19
- package/src/browser/contrib/terminal/component/terminal-command-suggest-controller.tsx +1 -1
- package/src/browser/index.ts +6 -69
- package/src/browser/languages/tree-sitter/wasm-manager.ts +2 -12
- package/src/browser/layout/ai-layout.tsx +2 -5
- package/src/browser/layout/layout.module.less +9 -9
- package/src/browser/layout/tabbar.view.tsx +8 -10
- package/src/browser/model/enhanceDecorationsCollection.ts +77 -62
- package/src/browser/model/msg-history-manager.ts +2 -56
- package/src/browser/model/styles.module.less +7 -0
- package/src/browser/preferences/schema.ts +0 -69
- package/src/browser/types.ts +5 -100
- package/src/browser/widget/inline-chat/inline-chat-editor.controller.ts +65 -30
- package/src/browser/widget/inline-chat/inline-chat.feature.registry.ts +90 -23
- package/src/browser/widget/inline-chat/inline-chat.service.ts +17 -2
- package/src/browser/widget/inline-chat/inline-content-widget.tsx +69 -14
- package/src/browser/widget/inline-diff/inline-diff-previewer.ts +32 -87
- package/src/browser/widget/inline-diff/inline-diff.controller.ts +114 -90
- package/src/browser/widget/inline-hint/inline-hint.controller.ts +7 -1
- package/src/browser/widget/inline-input/inline-input-widget.tsx +12 -34
- package/src/browser/widget/inline-input/inline-input.controller.ts +242 -454
- package/src/browser/widget/inline-input/inline-input.module.less +0 -4
- package/src/browser/widget/inline-input/inline-input.service.ts +13 -92
- package/src/browser/widget/inline-stream-diff/inline-stream-diff.handler.tsx +67 -58
- package/src/browser/widget/inline-stream-diff/live-preview.component.tsx +6 -49
- package/src/browser/widget/inline-stream-diff/live-preview.decoration.tsx +112 -41
- package/src/common/index.ts +0 -15
- package/src/common/types.ts +0 -22
- package/src/common/utils.ts +2 -4
- package/src/node/index.ts +0 -21
- package/lib/browser/components/ChatContext/ContextSelector.d.ts +0 -12
- package/lib/browser/components/ChatContext/ContextSelector.d.ts.map +0 -1
- package/lib/browser/components/ChatContext/ContextSelector.js +0 -113
- package/lib/browser/components/ChatContext/ContextSelector.js.map +0 -1
- package/lib/browser/components/ChatContext/index.d.ts +0 -4
- package/lib/browser/components/ChatContext/index.d.ts.map +0 -1
- package/lib/browser/components/ChatContext/index.js +0 -100
- package/lib/browser/components/ChatContext/index.js.map +0 -1
- package/lib/browser/components/ChatContext/style.module.less +0 -201
- package/lib/browser/components/ChatHistory.d.ts +0 -21
- package/lib/browser/components/ChatHistory.d.ts.map +0 -1
- package/lib/browser/components/ChatHistory.js +0 -148
- package/lib/browser/components/ChatHistory.js.map +0 -1
- package/lib/browser/components/ChatToolRender.d.ts +0 -7
- package/lib/browser/components/ChatToolRender.d.ts.map +0 -1
- package/lib/browser/components/ChatToolRender.js +0 -71
- package/lib/browser/components/ChatToolRender.js.map +0 -1
- package/lib/browser/components/ChatToolRender.module.less +0 -86
- package/lib/browser/components/chat-history.css +0 -139
- package/lib/browser/context/llm-context.contribution.d.ts +0 -7
- package/lib/browser/context/llm-context.contribution.d.ts.map +0 -1
- package/lib/browser/context/llm-context.contribution.js +0 -21
- package/lib/browser/context/llm-context.contribution.js.map +0 -1
- package/lib/browser/context/llm-context.service.d.ts +0 -36
- package/lib/browser/context/llm-context.service.d.ts.map +0 -1
- package/lib/browser/context/llm-context.service.js +0 -170
- package/lib/browser/context/llm-context.service.js.map +0 -1
- package/lib/browser/contrib/intelligent-completions/source/trigger.source.d.ts +0 -13
- package/lib/browser/contrib/intelligent-completions/source/trigger.source.d.ts.map +0 -1
- package/lib/browser/contrib/intelligent-completions/source/trigger.source.js +0 -36
- package/lib/browser/contrib/intelligent-completions/source/trigger.source.js.map +0 -1
- package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts +0 -9
- package/lib/browser/contrib/intelligent-completions/source/typing.source.d.ts.map +0 -1
- package/lib/browser/contrib/intelligent-completions/source/typing.source.js +0 -36
- package/lib/browser/contrib/intelligent-completions/source/typing.source.js.map +0 -1
- package/lib/browser/mcp/base-apply.service.d.ts +0 -67
- package/lib/browser/mcp/base-apply.service.d.ts.map +0 -1
- package/lib/browser/mcp/base-apply.service.js +0 -290
- package/lib/browser/mcp/base-apply.service.js.map +0 -1
- package/lib/browser/mcp/mcp-server-proxy.service.d.ts +0 -30
- package/lib/browser/mcp/mcp-server-proxy.service.d.ts.map +0 -1
- package/lib/browser/mcp/mcp-server-proxy.service.js +0 -57
- package/lib/browser/mcp/mcp-server-proxy.service.js.map +0 -1
- package/lib/browser/mcp/mcp-server.feature.registry.d.ts +0 -20
- package/lib/browser/mcp/mcp-server.feature.registry.d.ts.map +0 -1
- package/lib/browser/mcp/mcp-server.feature.registry.js +0 -69
- package/lib/browser/mcp/mcp-server.feature.registry.js.map +0 -1
- package/lib/browser/mcp/mcp-tools-dialog.module.less +0 -44
- package/lib/browser/mcp/mcp-tools-dialog.view.d.ts +0 -8
- package/lib/browser/mcp/mcp-tools-dialog.view.d.ts.map +0 -1
- package/lib/browser/mcp/mcp-tools-dialog.view.js +0 -16
- package/lib/browser/mcp/mcp-tools-dialog.view.js.map +0 -1
- package/lib/browser/mcp/tools/components/EditFile.d.ts +0 -3
- package/lib/browser/mcp/tools/components/EditFile.d.ts.map +0 -1
- package/lib/browser/mcp/tools/components/EditFile.js +0 -101
- package/lib/browser/mcp/tools/components/EditFile.js.map +0 -1
- package/lib/browser/mcp/tools/components/SearchResult.d.ts +0 -11
- package/lib/browser/mcp/tools/components/SearchResult.d.ts.map +0 -1
- package/lib/browser/mcp/tools/components/SearchResult.js +0 -60
- package/lib/browser/mcp/tools/components/SearchResult.js.map +0 -1
- package/lib/browser/mcp/tools/components/Terminal.d.ts +0 -4
- package/lib/browser/mcp/tools/components/Terminal.d.ts.map +0 -1
- package/lib/browser/mcp/tools/components/Terminal.js +0 -64
- package/lib/browser/mcp/tools/components/Terminal.js.map +0 -1
- package/lib/browser/mcp/tools/components/index.module.less +0 -168
- package/lib/browser/mcp/tools/createNewFileWithText.d.ts +0 -9
- package/lib/browser/mcp/tools/createNewFileWithText.d.ts.map +0 -1
- package/lib/browser/mcp/tools/createNewFileWithText.js +0 -82
- package/lib/browser/mcp/tools/createNewFileWithText.js.map +0 -1
- package/lib/browser/mcp/tools/editFile.d.ts +0 -8
- package/lib/browser/mcp/tools/editFile.d.ts.map +0 -1
- package/lib/browser/mcp/tools/editFile.js +0 -95
- package/lib/browser/mcp/tools/editFile.js.map +0 -1
- package/lib/browser/mcp/tools/fileSearch.d.ts +0 -10
- package/lib/browser/mcp/tools/fileSearch.d.ts.map +0 -1
- package/lib/browser/mcp/tools/fileSearch.js +0 -94
- package/lib/browser/mcp/tools/fileSearch.js.map +0 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.d.ts +0 -10
- package/lib/browser/mcp/tools/getDiagnosticsByPath.d.ts.map +0 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.js +0 -118
- package/lib/browser/mcp/tools/getDiagnosticsByPath.js.map +0 -1
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.d.ts +0 -11
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.d.ts.map +0 -1
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js +0 -118
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js.map +0 -1
- package/lib/browser/mcp/tools/grepSearch.d.ts +0 -10
- package/lib/browser/mcp/tools/grepSearch.d.ts.map +0 -1
- package/lib/browser/mcp/tools/grepSearch.js +0 -118
- package/lib/browser/mcp/tools/grepSearch.js.map +0 -1
- package/lib/browser/mcp/tools/handlers/EditFile.d.ts +0 -10
- package/lib/browser/mcp/tools/handlers/EditFile.d.ts.map +0 -1
- package/lib/browser/mcp/tools/handlers/EditFile.js +0 -28
- package/lib/browser/mcp/tools/handlers/EditFile.js.map +0 -1
- package/lib/browser/mcp/tools/handlers/ListDir.d.ts +0 -21
- package/lib/browser/mcp/tools/handlers/ListDir.d.ts.map +0 -1
- package/lib/browser/mcp/tools/handlers/ListDir.js +0 -112
- package/lib/browser/mcp/tools/handlers/ListDir.js.map +0 -1
- package/lib/browser/mcp/tools/handlers/ReadFile.d.ts +0 -53
- package/lib/browser/mcp/tools/handlers/ReadFile.d.ts.map +0 -1
- package/lib/browser/mcp/tools/handlers/ReadFile.js +0 -161
- package/lib/browser/mcp/tools/handlers/ReadFile.js.map +0 -1
- package/lib/browser/mcp/tools/handlers/RunCommand.d.ts +0 -43
- package/lib/browser/mcp/tools/handlers/RunCommand.d.ts.map +0 -1
- package/lib/browser/mcp/tools/handlers/RunCommand.js +0 -104
- package/lib/browser/mcp/tools/handlers/RunCommand.js.map +0 -1
- package/lib/browser/mcp/tools/handlers/utils.d.ts +0 -2
- package/lib/browser/mcp/tools/handlers/utils.d.ts.map +0 -1
- package/lib/browser/mcp/tools/handlers/utils.js +0 -7
- package/lib/browser/mcp/tools/handlers/utils.js.map +0 -1
- package/lib/browser/mcp/tools/listDir.d.ts +0 -8
- package/lib/browser/mcp/tools/listDir.d.ts.map +0 -1
- package/lib/browser/mcp/tools/listDir.js +0 -64
- package/lib/browser/mcp/tools/listDir.js.map +0 -1
- package/lib/browser/mcp/tools/readFile.d.ts +0 -8
- package/lib/browser/mcp/tools/readFile.d.ts.map +0 -1
- package/lib/browser/mcp/tools/readFile.js +0 -81
- package/lib/browser/mcp/tools/readFile.js.map +0 -1
- package/lib/browser/mcp/tools/runTerminalCmd.d.ts +0 -13
- package/lib/browser/mcp/tools/runTerminalCmd.d.ts.map +0 -1
- package/lib/browser/mcp/tools/runTerminalCmd.js +0 -49
- package/lib/browser/mcp/tools/runTerminalCmd.js.map +0 -1
- package/lib/browser/widget/inline-input/model.d.ts +0 -34
- package/lib/browser/widget/inline-input/model.d.ts.map +0 -1
- package/lib/browser/widget/inline-input/model.js +0 -63
- package/lib/browser/widget/inline-input/model.js.map +0 -1
- package/lib/common/llm-context.d.ts +0 -40
- package/lib/common/llm-context.d.ts.map +0 -1
- package/lib/common/llm-context.js +0 -5
- package/lib/common/llm-context.js.map +0 -1
- package/lib/common/mcp-server-manager.d.ts +0 -40
- package/lib/common/mcp-server-manager.d.ts.map +0 -1
- package/lib/common/mcp-server-manager.js +0 -6
- package/lib/common/mcp-server-manager.js.map +0 -1
- package/lib/common/prompts/context-prompt-provider.d.ts +0 -14
- package/lib/common/prompts/context-prompt-provider.d.ts.map +0 -1
- package/lib/common/prompts/context-prompt-provider.js +0 -38
- package/lib/common/prompts/context-prompt-provider.js.map +0 -1
- package/lib/common/tool-invocation-registry.d.ts +0 -92
- package/lib/common/tool-invocation-registry.d.ts.map +0 -1
- package/lib/common/tool-invocation-registry.js +0 -90
- package/lib/common/tool-invocation-registry.js.map +0 -1
- package/lib/node/anthropic/anthropic-language-model.d.ts +0 -9
- package/lib/node/anthropic/anthropic-language-model.d.ts.map +0 -1
- package/lib/node/anthropic/anthropic-language-model.js +0 -26
- package/lib/node/anthropic/anthropic-language-model.js.map +0 -1
- package/lib/node/base-language-model.d.ts +0 -14
- package/lib/node/base-language-model.d.ts.map +0 -1
- package/lib/node/base-language-model.js +0 -140
- package/lib/node/base-language-model.js.map +0 -1
- package/lib/node/deepseek/deepseek-language-model.d.ts +0 -9
- package/lib/node/deepseek/deepseek-language-model.d.ts.map +0 -1
- package/lib/node/deepseek/deepseek-language-model.js +0 -26
- package/lib/node/deepseek/deepseek-language-model.js.map +0 -1
- package/lib/node/mcp/sumi-mcp-server.d.ts +0 -91
- package/lib/node/mcp/sumi-mcp-server.d.ts.map +0 -1
- package/lib/node/mcp/sumi-mcp-server.js +0 -175
- package/lib/node/mcp/sumi-mcp-server.js.map +0 -1
- package/lib/node/mcp-server-manager-impl.d.ts +0 -27
- package/lib/node/mcp-server-manager-impl.d.ts.map +0 -1
- package/lib/node/mcp-server-manager-impl.js +0 -128
- package/lib/node/mcp-server-manager-impl.js.map +0 -1
- package/lib/node/mcp-server.d.ts +0 -207
- package/lib/node/mcp-server.d.ts.map +0 -1
- package/lib/node/mcp-server.js +0 -92
- package/lib/node/mcp-server.js.map +0 -1
- package/lib/node/openai/openai-language-model.d.ts +0 -9
- package/lib/node/openai/openai-language-model.d.ts.map +0 -1
- package/lib/node/openai/openai-language-model.js +0 -29
- package/lib/node/openai/openai-language-model.js.map +0 -1
- package/src/browser/components/ChatContext/ContextSelector.tsx +0 -177
- package/src/browser/components/ChatContext/index.tsx +0 -151
- package/src/browser/components/ChatContext/style.module.less +0 -201
- package/src/browser/components/ChatHistory.tsx +0 -292
- package/src/browser/components/ChatToolRender.module.less +0 -86
- package/src/browser/components/ChatToolRender.tsx +0 -96
- package/src/browser/components/chat-history.css +0 -139
- package/src/browser/context/llm-context.contribution.ts +0 -14
- package/src/browser/context/llm-context.service.ts +0 -200
- package/src/browser/contrib/intelligent-completions/source/trigger.source.ts +0 -44
- package/src/browser/contrib/intelligent-completions/source/typing.source.ts +0 -34
- package/src/browser/mcp/base-apply.service.ts +0 -349
- package/src/browser/mcp/mcp-server-proxy.service.ts +0 -55
- package/src/browser/mcp/mcp-server.feature.registry.ts +0 -77
- package/src/browser/mcp/mcp-tools-dialog.module.less +0 -44
- package/src/browser/mcp/mcp-tools-dialog.view.tsx +0 -24
- package/src/browser/mcp/tools/components/EditFile.tsx +0 -144
- package/src/browser/mcp/tools/components/SearchResult.tsx +0 -92
- package/src/browser/mcp/tools/components/Terminal.tsx +0 -97
- package/src/browser/mcp/tools/components/index.module.less +0 -168
- package/src/browser/mcp/tools/createNewFileWithText.ts +0 -82
- package/src/browser/mcp/tools/editFile.ts +0 -100
- package/src/browser/mcp/tools/fileSearch.ts +0 -99
- package/src/browser/mcp/tools/getDiagnosticsByPath.ts +0 -122
- package/src/browser/mcp/tools/getOpenEditorFileDiagnostics.ts +0 -120
- package/src/browser/mcp/tools/grepSearch.ts +0 -121
- package/src/browser/mcp/tools/handlers/EditFile.ts +0 -21
- package/src/browser/mcp/tools/handlers/ListDir.ts +0 -117
- package/src/browser/mcp/tools/handlers/ReadFile.ts +0 -192
- package/src/browser/mcp/tools/handlers/RunCommand.ts +0 -115
- package/src/browser/mcp/tools/handlers/utils.ts +0 -3
- package/src/browser/mcp/tools/listDir.ts +0 -65
- package/src/browser/mcp/tools/readFile.ts +0 -81
- package/src/browser/mcp/tools/runTerminalCmd.ts +0 -45
- package/src/browser/widget/inline-input/model.ts +0 -74
- package/src/common/llm-context.ts +0 -47
- package/src/common/mcp-server-manager.ts +0 -51
- package/src/common/prompts/context-prompt-provider.ts +0 -46
- package/src/common/tool-invocation-registry.ts +0 -168
- package/src/node/anthropic/anthropic-language-model.ts +0 -25
- package/src/node/base-language-model.ts +0 -177
- package/src/node/deepseek/deepseek-language-model.ts +0 -25
- package/src/node/mcp/sumi-mcp-server.ts +0 -200
- package/src/node/mcp-server-manager-impl.ts +0 -156
- package/src/node/mcp-server.ts +0 -127
- package/src/node/openai/openai-language-model.ts +0 -25
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MessageList } from 'react-chat-elements';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
AINativeConfigService,
|
|
6
|
-
getIcon,
|
|
7
|
-
useEventEffect,
|
|
8
|
-
useInjectable,
|
|
9
|
-
useUpdateOnEvent,
|
|
10
|
-
} from '@opensumi/ide-core-browser';
|
|
4
|
+
import { getIcon, useInjectable, useUpdateOnEvent } from '@opensumi/ide-core-browser';
|
|
11
5
|
import { Popover, PopoverPosition } from '@opensumi/ide-core-browser/lib/components';
|
|
12
6
|
import { EnhanceIcon } from '@opensumi/ide-core-browser/lib/components/ai-native';
|
|
13
7
|
import {
|
|
@@ -21,39 +15,23 @@ import {
|
|
|
21
15
|
ChatRenderRegistryToken,
|
|
22
16
|
ChatServiceToken,
|
|
23
17
|
Disposable,
|
|
24
|
-
DisposableCollection,
|
|
25
18
|
IAIReporter,
|
|
26
19
|
IChatComponent,
|
|
27
20
|
IChatContent,
|
|
28
|
-
MessageType,
|
|
29
|
-
formatLocalize,
|
|
30
21
|
localize,
|
|
31
22
|
uuid,
|
|
32
23
|
} from '@opensumi/ide-core-common';
|
|
33
24
|
import { IMainLayoutService } from '@opensumi/ide-main-layout';
|
|
34
|
-
import { IDialogService } from '@opensumi/ide-overlay';
|
|
35
25
|
|
|
36
26
|
import 'react-chat-elements/dist/main.css';
|
|
37
|
-
import {
|
|
38
|
-
AI_CHAT_VIEW_ID,
|
|
39
|
-
IChatAgentService,
|
|
40
|
-
IChatInternalService,
|
|
41
|
-
IChatMessageStructure,
|
|
42
|
-
TokenMCPServerProxyService,
|
|
43
|
-
} from '../../common';
|
|
44
|
-
import { LLMContextService, LLMContextServiceToken } from '../../common/llm-context';
|
|
45
|
-
import { ChatAgentPromptProvider } from '../../common/prompts/context-prompt-provider';
|
|
46
|
-
import { ChatContext } from '../components/ChatContext';
|
|
27
|
+
import { AI_CHAT_VIEW_ID, IChatAgentService, IChatInternalService, IChatMessageStructure } from '../../common';
|
|
47
28
|
import { CodeBlockWrapperInput } from '../components/ChatEditor';
|
|
48
|
-
import ChatHistory, { IChatHistoryItem } from '../components/ChatHistory';
|
|
49
29
|
import { ChatInput } from '../components/ChatInput';
|
|
50
30
|
import { ChatMarkdown } from '../components/ChatMarkdown';
|
|
51
31
|
import { ChatNotify, ChatReply } from '../components/ChatReply';
|
|
52
32
|
import { SlashCustomRender } from '../components/SlashCustomRender';
|
|
53
33
|
import { MessageData, createMessageByAI, createMessageByUser } from '../components/utils';
|
|
54
34
|
import { WelcomeMessage } from '../components/WelcomeMsg';
|
|
55
|
-
import { MCPServerProxyService } from '../mcp/mcp-server-proxy.service';
|
|
56
|
-
import { MCPToolsDialog } from '../mcp/mcp-tools-dialog.view';
|
|
57
35
|
import { ChatViewHeaderRender, TSlashCommandCustomRender } from '../types';
|
|
58
36
|
|
|
59
37
|
import { ChatRequestModel, ChatSlashCommandItemModel } from './chat-model';
|
|
@@ -63,6 +41,7 @@ import { ChatFeatureRegistry } from './chat.feature.registry';
|
|
|
63
41
|
import { ChatInternalService } from './chat.internal.service';
|
|
64
42
|
import styles from './chat.module.less';
|
|
65
43
|
import { ChatRenderRegistry } from './chat.render.registry';
|
|
44
|
+
|
|
66
45
|
const SCROLL_CLASSNAME = 'chat_scroll';
|
|
67
46
|
|
|
68
47
|
interface TDispatchAction {
|
|
@@ -70,8 +49,6 @@ interface TDispatchAction {
|
|
|
70
49
|
payload?: MessageData[];
|
|
71
50
|
}
|
|
72
51
|
|
|
73
|
-
const MAX_TITLE_LENGTH = 100;
|
|
74
|
-
|
|
75
52
|
export const AIChatView = () => {
|
|
76
53
|
const aiChatService = useInjectable<ChatInternalService>(IChatInternalService);
|
|
77
54
|
const chatApiService = useInjectable<ChatService>(ChatServiceToken);
|
|
@@ -79,16 +56,10 @@ export const AIChatView = () => {
|
|
|
79
56
|
const chatAgentService = useInjectable<IChatAgentService>(IChatAgentService);
|
|
80
57
|
const chatFeatureRegistry = useInjectable<ChatFeatureRegistry>(ChatFeatureRegistryToken);
|
|
81
58
|
const chatRenderRegistry = useInjectable<ChatRenderRegistry>(ChatRenderRegistryToken);
|
|
82
|
-
const contextService = useInjectable<LLMContextService>(LLMContextServiceToken);
|
|
83
|
-
const promptProvider = useInjectable<ChatAgentPromptProvider>(ChatAgentPromptProvider);
|
|
84
|
-
|
|
85
59
|
const layoutService = useInjectable<IMainLayoutService>(IMainLayoutService);
|
|
86
|
-
const mcpServerProxyService = useInjectable<MCPServerProxyService>(TokenMCPServerProxyService);
|
|
87
60
|
const msgHistoryManager = aiChatService.sessionModel.history;
|
|
88
61
|
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
89
62
|
const chatInputRef = React.useRef<{ setInputValue: (v: string) => void } | null>(null);
|
|
90
|
-
const dialogService = useInjectable<IDialogService>(IDialogService);
|
|
91
|
-
const aiNativeConfigService = useInjectable<AINativeConfigService>(AINativeConfigService);
|
|
92
63
|
|
|
93
64
|
const [shortcutCommands, setShortcutCommands] = React.useState<ChatSlashCommandItemModel[]>([]);
|
|
94
65
|
|
|
@@ -110,7 +81,6 @@ export const AIChatView = () => {
|
|
|
110
81
|
const [defaultAgentId, setDefaultAgentId] = React.useState<string>('');
|
|
111
82
|
const [command, setCommand] = React.useState('');
|
|
112
83
|
const [theme, setTheme] = React.useState<string | null>(null);
|
|
113
|
-
const [mcpToolsCount, setMcpToolsCount] = React.useState<number>(0);
|
|
114
84
|
|
|
115
85
|
React.useEffect(() => {
|
|
116
86
|
const featureSlashCommands = chatFeatureRegistry.getAllShortcutSlashCommand();
|
|
@@ -453,9 +423,7 @@ export const AIChatView = () => {
|
|
|
453
423
|
setLoading(false);
|
|
454
424
|
}}
|
|
455
425
|
onRegenerate={() => {
|
|
456
|
-
|
|
457
|
-
aiChatService.sendRequest(request, true);
|
|
458
|
-
}
|
|
426
|
+
aiChatService.sendRequest(request, true);
|
|
459
427
|
}}
|
|
460
428
|
msgId={msgId}
|
|
461
429
|
/>
|
|
@@ -510,10 +478,7 @@ export const AIChatView = () => {
|
|
|
510
478
|
const { message, agentId, command, reportExtra } = value;
|
|
511
479
|
const { actionType, actionSource } = reportExtra || {};
|
|
512
480
|
|
|
513
|
-
const
|
|
514
|
-
const fullMessage = await promptProvider.provideContextPrompt(context, message);
|
|
515
|
-
|
|
516
|
-
const request = aiChatService.createRequest(fullMessage, agentId!, command);
|
|
481
|
+
const request = aiChatService.createRequest(message, agentId!, command);
|
|
517
482
|
if (!request) {
|
|
518
483
|
return;
|
|
519
484
|
}
|
|
@@ -618,8 +583,7 @@ export const AIChatView = () => {
|
|
|
618
583
|
});
|
|
619
584
|
} else if (msg.role === ChatMessageRole.Assistant && msg.requestId) {
|
|
620
585
|
const request = aiChatService.sessionModel.getRequest(msg.requestId)!;
|
|
621
|
-
|
|
622
|
-
if (request && !request.response.isComplete) {
|
|
586
|
+
if (!request.response.isComplete) {
|
|
623
587
|
setLoading(true);
|
|
624
588
|
}
|
|
625
589
|
await renderReply({
|
|
@@ -629,7 +593,7 @@ export const AIChatView = () => {
|
|
|
629
593
|
agentId: msg.agentId,
|
|
630
594
|
command: msg.agentCommand,
|
|
631
595
|
startTime: msg.replyStartTime!,
|
|
632
|
-
request
|
|
596
|
+
request: aiChatService.sessionModel.getRequest(msg.requestId)!,
|
|
633
597
|
});
|
|
634
598
|
} else if (msg.role === ChatMessageRole.Assistant && msg.content) {
|
|
635
599
|
await renderSimpleMarkdownReply({
|
|
@@ -662,25 +626,6 @@ export const AIChatView = () => {
|
|
|
662
626
|
};
|
|
663
627
|
}, [aiChatService.sessionModel]);
|
|
664
628
|
|
|
665
|
-
useEventEffect(
|
|
666
|
-
mcpServerProxyService.onChangeMCPServers,
|
|
667
|
-
() => {
|
|
668
|
-
mcpServerProxyService.getAllMCPTools().then((tools) => {
|
|
669
|
-
setMcpToolsCount(tools.length);
|
|
670
|
-
});
|
|
671
|
-
},
|
|
672
|
-
[mcpServerProxyService],
|
|
673
|
-
);
|
|
674
|
-
|
|
675
|
-
const handleShowMCPTools = React.useCallback(async () => {
|
|
676
|
-
const tools = await mcpServerProxyService.getAllMCPTools();
|
|
677
|
-
dialogService.open({
|
|
678
|
-
message: <MCPToolsDialog tools={tools} />,
|
|
679
|
-
type: MessageType.Empty,
|
|
680
|
-
buttons: ['关闭'],
|
|
681
|
-
});
|
|
682
|
-
}, [mcpServerProxyService, dialogService]);
|
|
683
|
-
|
|
684
629
|
return (
|
|
685
630
|
<div id={styles.ai_chat_view}>
|
|
686
631
|
<div className={styles.header_container}>
|
|
@@ -697,15 +642,7 @@ export const AIChatView = () => {
|
|
|
697
642
|
dataSource={messageListData}
|
|
698
643
|
/>
|
|
699
644
|
</div>
|
|
700
|
-
{msgHistoryManager.slicedMessageCount ? (
|
|
701
|
-
<div className={styles.chat_tips_text}>
|
|
702
|
-
<div className={styles.chat_tips_container}>
|
|
703
|
-
{formatLocalize('aiNative.chat.ai.assistant.limit.message', msgHistoryManager.slicedMessageCount)}
|
|
704
|
-
</div>
|
|
705
|
-
</div>
|
|
706
|
-
) : null}
|
|
707
645
|
<div className={styles.chat_input_wrap}>
|
|
708
|
-
<ChatContext />
|
|
709
646
|
<div className={styles.header_operate}>
|
|
710
647
|
<div className={styles.header_operate_left}>
|
|
711
648
|
{shortcutCommands.map((command) => (
|
|
@@ -720,13 +657,7 @@ export const AIChatView = () => {
|
|
|
720
657
|
</Popover>
|
|
721
658
|
))}
|
|
722
659
|
</div>
|
|
723
|
-
<div className={styles.header_operate_right}>
|
|
724
|
-
{aiNativeConfigService.capabilities.supportsMCP && (
|
|
725
|
-
<div className={styles.tag} onClick={handleShowMCPTools}>
|
|
726
|
-
{`MCP Tools: ${mcpToolsCount}`}
|
|
727
|
-
</div>
|
|
728
|
-
)}
|
|
729
|
-
</div>
|
|
660
|
+
<div className={styles.header_operate_right}></div>
|
|
730
661
|
</div>
|
|
731
662
|
<ChatInputWrapperRender
|
|
732
663
|
onSend={(value, agentId, command) =>
|
|
@@ -765,121 +696,44 @@ export function DefaultChatViewHeader({
|
|
|
765
696
|
handleClear: () => any;
|
|
766
697
|
handleCloseChatView: () => any;
|
|
767
698
|
}) {
|
|
768
|
-
const
|
|
769
|
-
const [historyList, setHistoryList] = React.useState<IChatHistoryItem[]>([]);
|
|
770
|
-
const [currentTitle, setCurrentTitle] = React.useState<string>('');
|
|
771
|
-
const handleNewChat = React.useCallback(() => {
|
|
772
|
-
if (aiChatService.sessionModel.history.getMessages().length > 0) {
|
|
773
|
-
aiChatService.createSessionModel();
|
|
774
|
-
}
|
|
775
|
-
}, [aiChatService]);
|
|
776
|
-
const handleHistoryItemSelect = React.useCallback(
|
|
777
|
-
(item: IChatHistoryItem) => {
|
|
778
|
-
aiChatService.activateSession(item.id);
|
|
779
|
-
},
|
|
780
|
-
[aiChatService],
|
|
781
|
-
);
|
|
782
|
-
const handleHistoryItemDelete = React.useCallback(
|
|
783
|
-
(item: IChatHistoryItem) => {
|
|
784
|
-
aiChatService.clearSessionModel(item.id);
|
|
785
|
-
},
|
|
786
|
-
[aiChatService],
|
|
787
|
-
);
|
|
788
|
-
|
|
789
|
-
React.useEffect(() => {
|
|
790
|
-
const getHistoryList = () => {
|
|
791
|
-
const currentMessages = aiChatService.sessionModel.history.getMessages();
|
|
792
|
-
setCurrentTitle(
|
|
793
|
-
currentMessages.length > 0
|
|
794
|
-
? currentMessages[currentMessages.length - 1].content.slice(0, MAX_TITLE_LENGTH)
|
|
795
|
-
: '',
|
|
796
|
-
);
|
|
797
|
-
setHistoryList(
|
|
798
|
-
aiChatService.getSessions().map((session) => {
|
|
799
|
-
const history = session.history;
|
|
800
|
-
const messages = history.getMessages();
|
|
801
|
-
const title = messages.length > 0 ? messages[0].content.slice(0, MAX_TITLE_LENGTH) : '';
|
|
802
|
-
const updatedAt = messages.length > 0 ? messages[messages.length - 1].replyStartTime || 0 : 0;
|
|
803
|
-
// const loading = session.requests[session.requests.length - 1]?.response.isComplete;
|
|
804
|
-
return {
|
|
805
|
-
id: session.sessionId,
|
|
806
|
-
title,
|
|
807
|
-
updatedAt,
|
|
808
|
-
// TODO: 后续支持
|
|
809
|
-
loading: false,
|
|
810
|
-
};
|
|
811
|
-
}),
|
|
812
|
-
);
|
|
813
|
-
};
|
|
814
|
-
getHistoryList();
|
|
815
|
-
const toDispose = new DisposableCollection();
|
|
816
|
-
const sessionListenIds = new Set<string>();
|
|
817
|
-
toDispose.push(
|
|
818
|
-
aiChatService.onChangeSession((sessionId) => {
|
|
819
|
-
getHistoryList();
|
|
820
|
-
if (sessionListenIds.has(sessionId)) {
|
|
821
|
-
return;
|
|
822
|
-
}
|
|
823
|
-
sessionListenIds.add(sessionId);
|
|
824
|
-
toDispose.push(
|
|
825
|
-
aiChatService.sessionModel.history.onMessageChange(() => {
|
|
826
|
-
getHistoryList();
|
|
827
|
-
}),
|
|
828
|
-
);
|
|
829
|
-
}),
|
|
830
|
-
);
|
|
831
|
-
toDispose.push(
|
|
832
|
-
aiChatService.sessionModel.history.onMessageChange(() => {
|
|
833
|
-
getHistoryList();
|
|
834
|
-
}),
|
|
835
|
-
);
|
|
836
|
-
return () => {
|
|
837
|
-
toDispose.dispose();
|
|
838
|
-
};
|
|
839
|
-
}, [aiChatService]);
|
|
699
|
+
const aiAssistantName = React.useMemo(() => localize('aiNative.chat.ai.assistant.name'), []);
|
|
840
700
|
|
|
841
701
|
return (
|
|
842
|
-
|
|
843
|
-
<
|
|
844
|
-
className={styles.
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
tabIndex={0}
|
|
879
|
-
role='button'
|
|
880
|
-
ariaLabel={localize('aiNative.operate.close.title')}
|
|
881
|
-
/>
|
|
882
|
-
</Popover>
|
|
883
|
-
</div>
|
|
702
|
+
<>
|
|
703
|
+
<div className={styles.left}>
|
|
704
|
+
<span className={styles.title}>{aiAssistantName}</span>
|
|
705
|
+
</div>
|
|
706
|
+
<div className={styles.right}>
|
|
707
|
+
<Popover
|
|
708
|
+
overlayClassName={styles.popover_icon}
|
|
709
|
+
id={'ai-chat-header-clear'}
|
|
710
|
+
title={localize('aiNative.operate.clear.title')}
|
|
711
|
+
>
|
|
712
|
+
<EnhanceIcon
|
|
713
|
+
wrapperClassName={styles.action_btn}
|
|
714
|
+
className={getIcon('clear')}
|
|
715
|
+
onClick={handleClear}
|
|
716
|
+
tabIndex={0}
|
|
717
|
+
role='button'
|
|
718
|
+
ariaLabel={localize('aiNative.operate.clear.title')}
|
|
719
|
+
/>
|
|
720
|
+
</Popover>
|
|
721
|
+
<Popover
|
|
722
|
+
overlayClassName={styles.popover_icon}
|
|
723
|
+
id={'ai-chat-header-close'}
|
|
724
|
+
position={PopoverPosition.left}
|
|
725
|
+
title={localize('aiNative.operate.close.title')}
|
|
726
|
+
>
|
|
727
|
+
<EnhanceIcon
|
|
728
|
+
wrapperClassName={styles.action_btn}
|
|
729
|
+
className={getIcon('window-close')}
|
|
730
|
+
onClick={handleCloseChatView}
|
|
731
|
+
tabIndex={0}
|
|
732
|
+
role='button'
|
|
733
|
+
ariaLabel={localize('aiNative.operate.close.title')}
|
|
734
|
+
/>
|
|
735
|
+
</Popover>
|
|
736
|
+
</div>
|
|
737
|
+
</>
|
|
884
738
|
);
|
|
885
739
|
}
|
|
@@ -31,10 +31,9 @@ interface Props {
|
|
|
31
31
|
language?: string;
|
|
32
32
|
agentId?: string;
|
|
33
33
|
command?: string;
|
|
34
|
-
hideInsert?: boolean;
|
|
35
34
|
}
|
|
36
35
|
export const CodeEditorWithHighlight = (props: Props) => {
|
|
37
|
-
const { input, language, relationId, agentId, command
|
|
36
|
+
const { input, language, relationId, agentId, command } = props;
|
|
38
37
|
const ref = React.useRef<HTMLDivElement | null>(null);
|
|
39
38
|
const monacoCommandRegistry = useInjectable<MonacoCommandRegistry>(MonacoCommandRegistry);
|
|
40
39
|
const clipboardService = useInjectable<IClipboardService>(IClipboardService);
|
|
@@ -102,17 +101,15 @@ export const CodeEditorWithHighlight = (props: Props) => {
|
|
|
102
101
|
return (
|
|
103
102
|
<div className={styles.monaco_wrapper}>
|
|
104
103
|
<div className={styles.action_toolbar}>
|
|
105
|
-
{
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
</Popover>
|
|
115
|
-
)}
|
|
104
|
+
<Popover id={`ai-chat-inser-${useUUID}`} title={localize('aiNative.chat.code.insert')}>
|
|
105
|
+
<EnhanceIcon
|
|
106
|
+
className={getIcon('insert')}
|
|
107
|
+
onClick={() => handleInsert()}
|
|
108
|
+
tabIndex={0}
|
|
109
|
+
role='button'
|
|
110
|
+
ariaLabel={localize('aiNative.chat.code.insert')}
|
|
111
|
+
/>
|
|
112
|
+
</Popover>
|
|
116
113
|
<Popover
|
|
117
114
|
id={`ai-chat-copy-${useUUID}`}
|
|
118
115
|
title={localize(isCoping ? 'aiNative.chat.code.copy.success' : 'aiNative.chat.code.copy')}
|
|
@@ -15,7 +15,6 @@ import { ChatProxyService } from '../chat/chat-proxy.service';
|
|
|
15
15
|
import { ChatFeatureRegistry } from '../chat/chat.feature.registry';
|
|
16
16
|
import { IChatSlashCommandItem } from '../types';
|
|
17
17
|
|
|
18
|
-
import { ChatContext } from './ChatContext';
|
|
19
18
|
import styles from './components.module.less';
|
|
20
19
|
|
|
21
20
|
const INSTRUCTION_BOTTOM = 8;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import cls from 'classnames';
|
|
2
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import React, { ReactNode, useEffect, useRef, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { MarkdownReactParser, MarkdownReactRenderer } from '@opensumi/ide-components/lib/markdown-react';
|
|
5
5
|
import { IMarkedOptions, marked } from '@opensumi/ide-components/lib/utils';
|
|
@@ -17,7 +17,6 @@ interface MarkdownProps {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
fillInIncompleteTokens?: boolean; // 补齐不完整的 token,如代码块或表格
|
|
19
19
|
markedOptions?: IMarkedOptions;
|
|
20
|
-
hideInsert?: boolean;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export const ChatMarkdown = (props: MarkdownProps) => {
|
|
@@ -43,14 +42,13 @@ export const ChatMarkdown = (props: MarkdownProps) => {
|
|
|
43
42
|
<div className={styles.code}>
|
|
44
43
|
<ConfigProvider value={appConfig}>
|
|
45
44
|
<div className={styles.code_block}>
|
|
46
|
-
<div className={
|
|
45
|
+
<div className={styles.code_language}>{language}</div>
|
|
47
46
|
<CodeEditorWithHighlight
|
|
48
47
|
input={code as string}
|
|
49
48
|
language={language}
|
|
50
49
|
relationId={props.relationId || ''}
|
|
51
50
|
agentId={props.agentId}
|
|
52
51
|
command={props.command}
|
|
53
|
-
hideInsert={props.hideInsert}
|
|
54
52
|
/>
|
|
55
53
|
</div>
|
|
56
54
|
</ConfigProvider>
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
IChatComponent,
|
|
39
39
|
IChatContent,
|
|
40
40
|
IChatResponseProgressFileTreeData,
|
|
41
|
-
IChatToolContent,
|
|
42
41
|
URI,
|
|
43
42
|
} from '@opensumi/ide-core-common';
|
|
44
43
|
import { IIconService } from '@opensumi/ide-theme';
|
|
@@ -149,34 +148,7 @@ const TreeRenderer = (props: { treeData: IChatResponseProgressFileTreeData }) =>
|
|
|
149
148
|
);
|
|
150
149
|
};
|
|
151
150
|
|
|
152
|
-
const
|
|
153
|
-
const { toolCall, messageId } = props;
|
|
154
|
-
const chatAgentViewService = useInjectable<IChatAgentViewService>(ChatAgentViewServiceToken);
|
|
155
|
-
const [node, setNode] = useState<React.JSX.Element | null>(null);
|
|
156
|
-
|
|
157
|
-
useEffect(() => {
|
|
158
|
-
const config = chatAgentViewService.getChatComponent('toolCall');
|
|
159
|
-
if (config) {
|
|
160
|
-
const { component: Component, initialProps } = config;
|
|
161
|
-
setNode(<Component {...initialProps} value={toolCall} messageId={messageId} />);
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
setNode(
|
|
165
|
-
<div>
|
|
166
|
-
<Loading />
|
|
167
|
-
<span style={{ marginLeft: 4 }}>正在加载组件</span>
|
|
168
|
-
</div>,
|
|
169
|
-
);
|
|
170
|
-
const deferred = chatAgentViewService.getChatComponentDeferred('toolCall')!;
|
|
171
|
-
deferred.promise.then(({ component: Component, initialProps }) => {
|
|
172
|
-
setNode(<Component {...initialProps} value={toolCall} messageId={messageId} />);
|
|
173
|
-
});
|
|
174
|
-
}, [toolCall.state]);
|
|
175
|
-
|
|
176
|
-
return node;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
const ComponentRender = (props: { component: string; value?: unknown; messageId?: string }) => {
|
|
151
|
+
const ComponentRender = (props: { component: string; value?: unknown }) => {
|
|
180
152
|
const chatAgentViewService = useInjectable<IChatAgentViewService>(ChatAgentViewServiceToken);
|
|
181
153
|
const [node, setNode] = useState<React.JSX.Element | null>(null);
|
|
182
154
|
|
|
@@ -184,7 +156,7 @@ const ComponentRender = (props: { component: string; value?: unknown; messageId?
|
|
|
184
156
|
const config = chatAgentViewService.getChatComponent(props.component);
|
|
185
157
|
if (config) {
|
|
186
158
|
const { component: Component, initialProps } = config;
|
|
187
|
-
setNode(<Component {...initialProps} value={props.value}
|
|
159
|
+
setNode(<Component {...initialProps} value={props.value} />);
|
|
188
160
|
return;
|
|
189
161
|
}
|
|
190
162
|
setNode(
|
|
@@ -224,6 +196,7 @@ export const ChatReply = (props: IChatReplyProps) => {
|
|
|
224
196
|
const chatApiService = useInjectable<ChatService>(ChatServiceToken);
|
|
225
197
|
const chatAgentService = useInjectable<IChatAgentService>(IChatAgentService);
|
|
226
198
|
const chatRenderRegistry = useInjectable<ChatRenderRegistry>(ChatRenderRegistryToken);
|
|
199
|
+
|
|
227
200
|
useEffect(() => {
|
|
228
201
|
const disposableCollection = new DisposableCollection();
|
|
229
202
|
|
|
@@ -297,6 +270,10 @@ export const ChatReply = (props: IChatReplyProps) => {
|
|
|
297
270
|
</div>
|
|
298
271
|
);
|
|
299
272
|
|
|
273
|
+
const renderComponent = (componentId: string, value: unknown) => (
|
|
274
|
+
<ComponentRender component={componentId} value={value} />
|
|
275
|
+
);
|
|
276
|
+
|
|
300
277
|
const contentNode = React.useMemo(
|
|
301
278
|
() =>
|
|
302
279
|
request.response.responseContents.map((item, index) => {
|
|
@@ -306,9 +283,7 @@ export const ChatReply = (props: IChatReplyProps) => {
|
|
|
306
283
|
} else if (item.kind === 'treeData') {
|
|
307
284
|
node = renderTreeData(item.treeData);
|
|
308
285
|
} else if (item.kind === 'component') {
|
|
309
|
-
node =
|
|
310
|
-
} else if (item.kind === 'toolCall') {
|
|
311
|
-
node = <ToolCallRender toolCall={item.content} messageId={msgId} />;
|
|
286
|
+
node = renderComponent(item.component, item.value);
|
|
312
287
|
} else {
|
|
313
288
|
node = renderMarkdown(item.content);
|
|
314
289
|
}
|
|
@@ -360,11 +335,7 @@ export const ChatReply = (props: IChatReplyProps) => {
|
|
|
360
335
|
|
|
361
336
|
return (
|
|
362
337
|
<ChatThinkingResult
|
|
363
|
-
hasMessage={
|
|
364
|
-
request.response.responseParts.length > 0 ||
|
|
365
|
-
request.response.responseContents.length > 0 ||
|
|
366
|
-
!!request.response.errorDetails?.message
|
|
367
|
-
}
|
|
338
|
+
hasMessage={request.response.responseParts.length > 0 || !!request.response.errorDetails?.message}
|
|
368
339
|
onRegenerate={handleRegenerate}
|
|
369
340
|
requestId={request.requestId}
|
|
370
341
|
>
|
|
@@ -118,7 +118,7 @@ export const ChatThinkingResult = ({
|
|
|
118
118
|
|
|
119
119
|
const isRenderRegenerate = useMemo(() => {
|
|
120
120
|
if (isUndefined(showRegenerate)) {
|
|
121
|
-
return latestRequestId === requestId
|
|
121
|
+
return latestRequestId === requestId;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
return !!showRegenerate;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import { isMarkdownString } from '@opensumi/monaco-editor-core/esm/vs/base/common/htmlContent';
|
|
15
15
|
|
|
16
16
|
import 'react-chat-elements/dist/main.css';
|
|
17
|
-
import { IChatAgentService, ISampleQuestions } from '../../common';
|
|
17
|
+
import { IChatAgentService, IChatReplyFollowup, ISampleQuestions } from '../../common';
|
|
18
18
|
import { ChatService } from '../chat/chat.api.service';
|
|
19
19
|
import { ChatFeatureRegistry } from '../chat/chat.feature.registry';
|
|
20
20
|
import { ChatRenderRegistry } from '../chat/chat.render.registry';
|
|
@@ -244,45 +244,44 @@
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
.
|
|
247
|
+
.code_block {
|
|
248
248
|
position: relative;
|
|
249
|
-
min-width:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
min-width: 100px;
|
|
250
|
+
margin-top: 4px;
|
|
251
|
+
.monaco_wrapper {
|
|
252
|
+
position: relative;
|
|
253
|
+
min-width: 130px;
|
|
254
|
+
> pre {
|
|
255
|
+
margin-bottom: 10px;
|
|
256
|
+
}
|
|
257
|
+
.editor {
|
|
258
|
+
border-radius: 8px;
|
|
259
|
+
font-size: 12px;
|
|
260
|
+
padding: 32px 8px 8px 8px;
|
|
261
|
+
line-height: 18px;
|
|
262
|
+
&::-webkit-scrollbar {
|
|
263
|
+
width: auto;
|
|
264
|
+
height: 4px;
|
|
265
|
+
}
|
|
261
266
|
}
|
|
262
|
-
}
|
|
263
267
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
268
|
+
.action_toolbar {
|
|
269
|
+
display: flex;
|
|
270
|
+
position: absolute;
|
|
271
|
+
right: 8px;
|
|
272
|
+
top: 6px;
|
|
273
|
+
z-index: 100;
|
|
274
|
+
height: 20px;
|
|
275
|
+
align-items: center;
|
|
276
|
+
overflow: hidden;
|
|
273
277
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
:global {
|
|
279
|
+
.kt-popover {
|
|
280
|
+
height: inherit;
|
|
281
|
+
}
|
|
277
282
|
}
|
|
278
283
|
}
|
|
279
284
|
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.code_block {
|
|
283
|
-
position: relative;
|
|
284
|
-
min-width: 100px;
|
|
285
|
-
margin-top: 4px;
|
|
286
285
|
|
|
287
286
|
:global {
|
|
288
287
|
.hljs {
|
|
@@ -300,7 +299,6 @@
|
|
|
300
299
|
background-color: var(--design-language-background);
|
|
301
300
|
border-radius: 8px 0px 8px 0;
|
|
302
301
|
color: var(--design-text-foreground);
|
|
303
|
-
font-size: 12px;
|
|
304
302
|
}
|
|
305
303
|
}
|
|
306
304
|
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { Disposable, ECodeEditsSourceTyping } from '@opensumi/ide-core-common';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ITriggerData } from './source/trigger.source';
|
|
2
|
+
import { IPosition, IRange, InlineCompletion } from '@opensumi/ide-monaco';
|
|
5
3
|
|
|
6
4
|
import type { ILineChangeData } from './source/line-change.source';
|
|
7
5
|
import type { ILinterErrorData } from './source/lint-error.source';
|
|
8
6
|
|
|
9
|
-
/**
|
|
10
|
-
* 有效弃用时间(毫秒)
|
|
11
|
-
* 在可见的情况下超过 750ms 弃用才算有效数据,否则视为无效数据
|
|
12
|
-
*/
|
|
13
|
-
export const VALID_TIME = 750;
|
|
14
|
-
|
|
15
7
|
export interface IIntelligentCompletionsResult<T = any> {
|
|
16
8
|
readonly items: InlineCompletion[];
|
|
17
9
|
/**
|
|
@@ -20,16 +12,9 @@ export interface IIntelligentCompletionsResult<T = any> {
|
|
|
20
12
|
extra?: T;
|
|
21
13
|
}
|
|
22
14
|
|
|
23
|
-
export
|
|
24
|
-
typing: ECodeEditsSourceTyping;
|
|
25
|
-
position: IPosition;
|
|
26
|
-
data: {
|
|
27
|
-
[ECodeEditsSourceTyping.LinterErrors]?: ILinterErrorData;
|
|
28
|
-
[ECodeEditsSourceTyping.LineChange]?: ILineChangeData;
|
|
29
|
-
[ECodeEditsSourceTyping.Typing]?: IModelContentChangedEvent;
|
|
30
|
-
[ECodeEditsSourceTyping.Trigger]?: ITriggerData;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
15
|
+
export type ICodeEditsContextBean =
|
|
16
|
+
| { typing: ECodeEditsSourceTyping.LinterErrors; position: IPosition; data: ILinterErrorData }
|
|
17
|
+
| { typing: ECodeEditsSourceTyping.LineChange; position: IPosition; data: ILineChangeData };
|
|
33
18
|
|
|
34
19
|
export interface ICodeEdit {
|
|
35
20
|
/**
|