@opensumi/ide-ai-native 3.8.3-next-1741752385.0 → 3.8.3-next-1741763229.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/chat/chat-agent.service.d.ts +1 -1
- package/lib/browser/chat/chat-agent.service.d.ts.map +1 -1
- package/lib/browser/chat/chat-agent.service.js +7 -7
- package/lib/browser/chat/chat-agent.service.js.map +1 -1
- package/lib/browser/chat/chat-model.d.ts +2 -2
- package/lib/browser/chat/chat-model.d.ts.map +1 -1
- package/lib/browser/chat/chat-model.js +18 -1
- package/lib/browser/chat/chat-model.js.map +1 -1
- package/lib/browser/chat/chat.view.d.ts.map +1 -1
- package/lib/browser/chat/chat.view.js +49 -18
- package/lib/browser/chat/chat.view.js.map +1 -1
- package/lib/browser/components/ChatEditor.d.ts +5 -2
- package/lib/browser/components/ChatEditor.d.ts.map +1 -1
- package/lib/browser/components/ChatEditor.js +45 -6
- package/lib/browser/components/ChatEditor.js.map +1 -1
- package/lib/browser/components/ChatMentionInput.d.ts +25 -0
- package/lib/browser/components/ChatMentionInput.d.ts.map +1 -0
- package/lib/browser/components/ChatMentionInput.js +221 -0
- package/lib/browser/components/ChatMentionInput.js.map +1 -0
- package/lib/browser/components/ChatReply.d.ts.map +1 -1
- package/lib/browser/components/ChatReply.js +35 -17
- 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 +1 -1
- package/lib/browser/components/WelcomeMsg.js.map +1 -1
- package/lib/browser/components/{ChatContext/ContextSelector.d.ts → chat-context/context-selector.d.ts} +1 -1
- package/lib/browser/components/chat-context/context-selector.d.ts.map +1 -0
- package/lib/browser/components/{ChatContext/ContextSelector.js → chat-context/context-selector.js} +1 -1
- package/lib/browser/components/chat-context/context-selector.js.map +1 -0
- package/lib/browser/components/chat-context/index.d.ts.map +1 -0
- package/lib/browser/components/{ChatContext → chat-context}/index.js +2 -2
- package/lib/browser/components/chat-context/index.js.map +1 -0
- package/lib/browser/components/components.module.less +43 -0
- package/lib/browser/components/mention-input/mention-input.d.ts +5 -0
- package/lib/browser/components/mention-input/mention-input.d.ts.map +1 -0
- package/lib/browser/components/mention-input/mention-input.js +753 -0
- package/lib/browser/components/mention-input/mention-input.js.map +1 -0
- package/lib/browser/components/mention-input/mention-input.module.less +327 -0
- package/lib/browser/components/mention-input/mention-item.d.ts +10 -0
- package/lib/browser/components/mention-input/mention-item.d.ts.map +1 -0
- package/lib/browser/components/mention-input/mention-item.js +16 -0
- package/lib/browser/components/mention-input/mention-item.js.map +1 -0
- package/lib/browser/components/mention-input/mention-panel.d.ts +15 -0
- package/lib/browser/components/mention-input/mention-panel.d.ts.map +1 -0
- package/lib/browser/components/mention-input/mention-panel.js +49 -0
- package/lib/browser/components/mention-input/mention-panel.js.map +1 -0
- package/lib/browser/components/mention-input/types.d.ts +76 -0
- package/lib/browser/components/mention-input/types.d.ts.map +1 -0
- package/lib/browser/components/mention-input/types.js +16 -0
- package/lib/browser/components/mention-input/types.js.map +1 -0
- package/lib/browser/context/llm-context.service.d.ts +10 -2
- package/lib/browser/context/llm-context.service.d.ts.map +1 -1
- package/lib/browser/context/llm-context.service.js +71 -2
- package/lib/browser/context/llm-context.service.js.map +1 -1
- package/lib/browser/contrib/inline-completions/prompt/matcher.js +2 -2
- package/lib/browser/contrib/inline-completions/prompt/similarSnippets.d.ts +1 -1
- package/lib/browser/contrib/inline-completions/prompt/similarSnippets.js +2 -2
- package/lib/browser/contrib/intelligent-completions/view/default.d.ts.map +1 -1
- package/lib/browser/contrib/intelligent-completions/view/default.js.map +1 -1
- package/lib/browser/mcp/config/components/mcp-config.view.d.ts.map +1 -1
- package/lib/browser/mcp/config/components/mcp-config.view.js +28 -18
- package/lib/browser/mcp/config/components/mcp-config.view.js.map +1 -1
- package/lib/browser/mcp/config/components/mcp-server-form.d.ts.map +1 -1
- package/lib/browser/mcp/config/components/mcp-server-form.js +33 -25
- package/lib/browser/mcp/config/components/mcp-server-form.js.map +1 -1
- package/lib/browser/mcp/mcp-server.feature.registry.js +1 -1
- package/lib/browser/mcp/mcp-server.feature.registry.js.map +1 -1
- package/lib/browser/mcp/tools/components/ExpandableFileList.d.ts.map +1 -1
- package/lib/browser/mcp/tools/components/ExpandableFileList.js +3 -1
- package/lib/browser/mcp/tools/components/ExpandableFileList.js.map +1 -1
- package/lib/browser/mcp/tools/components/Terminal.d.ts.map +1 -1
- package/lib/browser/mcp/tools/components/Terminal.js +6 -5
- package/lib/browser/mcp/tools/components/Terminal.js.map +1 -1
- package/lib/browser/mcp/tools/components/computeAnsiLogString.d.ts +4 -0
- package/lib/browser/mcp/tools/components/computeAnsiLogString.d.ts.map +1 -0
- package/lib/browser/mcp/tools/components/computeAnsiLogString.js +22 -0
- package/lib/browser/mcp/tools/components/computeAnsiLogString.js.map +1 -0
- package/lib/browser/mcp/tools/components/filterEraseMultipleLine.d.ts +18 -0
- package/lib/browser/mcp/tools/components/filterEraseMultipleLine.d.ts.map +1 -0
- package/lib/browser/mcp/tools/components/filterEraseMultipleLine.js +69 -0
- package/lib/browser/mcp/tools/components/filterEraseMultipleLine.js.map +1 -0
- package/lib/browser/mcp/tools/components/index.module.less +8 -5
- package/lib/browser/mcp/tools/createNewFileWithText.d.ts.map +1 -1
- package/lib/browser/mcp/tools/createNewFileWithText.js +1 -0
- package/lib/browser/mcp/tools/createNewFileWithText.js.map +1 -1
- package/lib/browser/mcp/tools/editFile.d.ts.map +1 -1
- package/lib/browser/mcp/tools/editFile.js +1 -0
- package/lib/browser/mcp/tools/editFile.js.map +1 -1
- package/lib/browser/mcp/tools/fileSearch.d.ts.map +1 -1
- package/lib/browser/mcp/tools/fileSearch.js +1 -0
- package/lib/browser/mcp/tools/fileSearch.js.map +1 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.d.ts.map +1 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.js +2 -1
- package/lib/browser/mcp/tools/getDiagnosticsByPath.js.map +1 -1
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.d.ts.map +1 -1
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js +2 -0
- package/lib/browser/mcp/tools/getOpenEditorFileDiagnostics.js.map +1 -1
- package/lib/browser/mcp/tools/grepSearch.d.ts.map +1 -1
- package/lib/browser/mcp/tools/grepSearch.js +1 -0
- package/lib/browser/mcp/tools/grepSearch.js.map +1 -1
- package/lib/browser/mcp/tools/listDir.d.ts.map +1 -1
- package/lib/browser/mcp/tools/listDir.js +1 -0
- package/lib/browser/mcp/tools/listDir.js.map +1 -1
- package/lib/browser/mcp/tools/readFile.d.ts.map +1 -1
- package/lib/browser/mcp/tools/readFile.js +1 -0
- package/lib/browser/mcp/tools/readFile.js.map +1 -1
- package/lib/browser/mcp/tools/runTerminalCmd.d.ts.map +1 -1
- package/lib/browser/mcp/tools/runTerminalCmd.js +1 -0
- package/lib/browser/mcp/tools/runTerminalCmd.js.map +1 -1
- package/lib/browser/types.d.ts +1 -0
- package/lib/browser/types.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-manager.d.ts.map +1 -1
- package/lib/browser/widget/inline-diff/inline-diff-manager.js.map +1 -1
- 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 +10 -5
- package/lib/browser/widget/inline-stream-diff/live-preview.decoration.js.map +1 -1
- package/lib/common/llm-context.d.ts +15 -1
- package/lib/common/llm-context.d.ts.map +1 -1
- package/lib/common/llm-context.js.map +1 -1
- package/lib/common/prompts/context-prompt-provider.d.ts +12 -2
- package/lib/common/prompts/context-prompt-provider.d.ts.map +1 -1
- package/lib/common/prompts/context-prompt-provider.js +94 -28
- package/lib/common/prompts/context-prompt-provider.js.map +1 -1
- package/lib/node/base-language-model.d.ts.map +1 -1
- package/lib/node/base-language-model.js +6 -0
- package/lib/node/base-language-model.js.map +1 -1
- package/package.json +24 -23
- package/src/browser/chat/chat-agent.service.ts +7 -7
- package/src/browser/chat/chat-model.ts +19 -2
- package/src/browser/chat/chat.view.tsx +63 -20
- package/src/browser/components/ChatEditor.tsx +72 -9
- package/src/browser/components/ChatMentionInput.tsx +268 -0
- package/src/browser/components/ChatReply.tsx +61 -18
- package/src/browser/components/ChatThinking.tsx +1 -1
- package/src/browser/components/WelcomeMsg.tsx +1 -1
- package/src/browser/components/{ChatContext → chat-context}/index.tsx +1 -1
- package/src/browser/components/components.module.less +43 -0
- package/src/browser/components/mention-input/mention-input.module.less +327 -0
- package/src/browser/components/mention-input/mention-input.tsx +943 -0
- package/src/browser/components/mention-input/mention-item.tsx +24 -0
- package/src/browser/components/mention-input/mention-panel.tsx +89 -0
- package/src/browser/components/mention-input/types.ts +82 -0
- package/src/browser/context/llm-context.service.ts +81 -3
- package/src/browser/contrib/inline-completions/prompt/matcher.ts +2 -2
- package/src/browser/contrib/inline-completions/prompt/similarSnippets.ts +2 -2
- package/src/browser/contrib/intelligent-completions/view/default.ts +0 -1
- package/src/browser/mcp/config/components/mcp-config.view.tsx +23 -12
- package/src/browser/mcp/config/components/mcp-server-form.tsx +68 -54
- package/src/browser/mcp/mcp-server.feature.registry.ts +1 -1
- package/src/browser/mcp/tools/components/ExpandableFileList.tsx +4 -1
- package/src/browser/mcp/tools/components/Terminal.tsx +4 -6
- package/src/browser/mcp/tools/components/computeAnsiLogString.ts +24 -0
- package/src/browser/mcp/tools/components/filterEraseMultipleLine.ts +71 -0
- package/src/browser/mcp/tools/components/index.module.less +8 -5
- package/src/browser/mcp/tools/createNewFileWithText.ts +1 -0
- package/src/browser/mcp/tools/editFile.ts +1 -0
- package/src/browser/mcp/tools/fileSearch.ts +1 -0
- package/src/browser/mcp/tools/getDiagnosticsByPath.ts +2 -1
- package/src/browser/mcp/tools/getOpenEditorFileDiagnostics.ts +2 -0
- package/src/browser/mcp/tools/grepSearch.ts +1 -0
- package/src/browser/mcp/tools/listDir.ts +1 -0
- package/src/browser/mcp/tools/readFile.ts +1 -0
- package/src/browser/mcp/tools/runTerminalCmd.ts +1 -0
- package/src/browser/types.ts +1 -0
- package/src/browser/widget/inline-diff/inline-diff-manager.tsx +0 -1
- package/src/browser/widget/inline-stream-diff/live-preview.decoration.tsx +9 -5
- package/src/common/llm-context.ts +16 -1
- package/src/common/prompts/context-prompt-provider.ts +126 -32
- package/src/node/base-language-model.ts +5 -0
- package/lib/browser/components/ChatContext/ContextSelector.d.ts.map +0 -1
- package/lib/browser/components/ChatContext/ContextSelector.js.map +0 -1
- package/lib/browser/components/ChatContext/index.d.ts.map +0 -1
- package/lib/browser/components/ChatContext/index.js.map +0 -1
- /package/lib/browser/components/{ChatContext → chat-context}/index.d.ts +0 -0
- /package/lib/browser/components/{ChatContext → chat-context}/style.module.less +0 -0
- /package/src/browser/components/{ChatContext/ContextSelector.tsx → chat-context/context-selector.tsx} +0 -0
- /package/src/browser/components/{ChatContext → chat-context}/style.module.less +0 -0
|
@@ -3,11 +3,11 @@ import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
|
3
3
|
import { useInjectable } from '@opensumi/ide-core-browser';
|
|
4
4
|
import { Button, Icon } from '@opensumi/ide-core-browser/lib/components';
|
|
5
5
|
import { localize } from '@opensumi/ide-core-common';
|
|
6
|
-
import { stripAnsi } from '@opensumi/ide-utils/lib/ansi';
|
|
7
6
|
|
|
8
7
|
import { IMCPServerToolComponentProps } from '../../../types';
|
|
9
8
|
import { RunCommandHandler } from '../handlers/RunCommand';
|
|
10
9
|
|
|
10
|
+
import { computeAnsiLogString } from './computeAnsiLogString';
|
|
11
11
|
import styles from './index.module.less';
|
|
12
12
|
|
|
13
13
|
function getResult(raw: string) {
|
|
@@ -63,19 +63,17 @@ export const TerminalToolComponent = memo((props: IMCPServerToolComponentProps)
|
|
|
63
63
|
<>
|
|
64
64
|
<div className={styles.command_title}>
|
|
65
65
|
<Icon icon='terminal' />
|
|
66
|
-
<span>{localize('ai.native.mcp.terminal.command')}
|
|
66
|
+
<span>{localize('ai.native.mcp.terminal.command')}:</span>
|
|
67
67
|
</div>
|
|
68
68
|
<p className={styles.command_content}>
|
|
69
69
|
<code>$ {args.command}</code>
|
|
70
70
|
</p>
|
|
71
71
|
</>
|
|
72
72
|
)}
|
|
73
|
-
<div className={styles.command_title}>
|
|
74
|
-
<span>{localize('ai.native.mcp.terminal.output')}</span>
|
|
75
|
-
</div>
|
|
76
73
|
{output ? (
|
|
77
74
|
<div className={styles.command_content}>
|
|
78
|
-
<
|
|
75
|
+
<Icon icon='output' />
|
|
76
|
+
<code dangerouslySetInnerHTML={{ __html: computeAnsiLogString(output.text || '') }} />
|
|
79
77
|
</div>
|
|
80
78
|
) : (
|
|
81
79
|
''
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import AnsiUp from 'ansi_up';
|
|
2
|
+
|
|
3
|
+
import filterEraseMultipleLine from './filterEraseMultipleLine';
|
|
4
|
+
|
|
5
|
+
type LogContent = string;
|
|
6
|
+
|
|
7
|
+
const ansiUp = new AnsiUp();
|
|
8
|
+
|
|
9
|
+
export function computeAnsiLogString(logs: LogContent, enableEraseLineFilter = true, hideEmptyLine = false): string {
|
|
10
|
+
const splittedLogs = logs.split('\n');
|
|
11
|
+
// 处理清空上行逻辑
|
|
12
|
+
// 上移 cursor + 清空整行
|
|
13
|
+
let filteredLogs = enableEraseLineFilter ? filterEraseMultipleLine(splittedLogs) : splittedLogs;
|
|
14
|
+
if (hideEmptyLine) {
|
|
15
|
+
filteredLogs = filteredLogs.map((line) => line.replace('\r', '')).filter((line) => !!line);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const htmlLogLines = filteredLogs.map((line) => {
|
|
19
|
+
const htmlLog = ansiUp.ansi_to_html(line);
|
|
20
|
+
|
|
21
|
+
return htmlLog;
|
|
22
|
+
});
|
|
23
|
+
return htmlLogLines.join('\n');
|
|
24
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export const ESC = '\u001B[';
|
|
2
|
+
export const eraseLine = ESC + '2K';
|
|
3
|
+
export const eraseEndLine = ESC + 'K';
|
|
4
|
+
|
|
5
|
+
export const cursorUp = (count = 1) => ESC + count + 'A';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 处理过滤清空上行,清空本行逻辑。
|
|
9
|
+
*
|
|
10
|
+
* 关于清空上 n 行:
|
|
11
|
+
* 一般在日志中,出现覆盖上行的情况,ascii 编码为 2K [1A 2K ...] 1G 的样式。 如 \u001b[2K\u001b[1A\u001b[2K\u001b[1A\u001b[2K\u001b[G\r\n,代表清空上两行。
|
|
12
|
+
* 其中,2K 代表清空整行,1A 代表光标上移,配合下一个 2K 则最终效果为清空上行,而 1G 是移动光标到本行开始(位置 1)。
|
|
13
|
+
* 在日志过滤过程中,可以只处理 1A 2K 这个序列,遇到后把该日志的上一行删掉即可。
|
|
14
|
+
*
|
|
15
|
+
* 关于清空本行,按顺序执行:
|
|
16
|
+
* 1. 在当前行没有 Cursor 操作符(如上移时),匹配最后一个 [2K (清空本行)或 \r[K(指针回 0,再清空本行到末尾,相当于清空本行),只输出 [2K 后的内容,
|
|
17
|
+
* 2. 在当前行没有 Cursor 操作符时且有多个 \r (carriage return charactor,移动光标到行首)时,reduce 按 \r \x1b[G 或 \x1b[1G 切分的片断,不段用后一 part 的部分从头覆盖得出结果。
|
|
18
|
+
*/
|
|
19
|
+
export default function filterEraseMultipleLine(logs: string[]) {
|
|
20
|
+
// 上移 cursor + 清空整行
|
|
21
|
+
const eraseLastLine = cursorUp(1) + eraseLine;
|
|
22
|
+
const eraseCurrentLine = eraseLine;
|
|
23
|
+
const eraseCurrentLine2 = `\r${eraseEndLine}`;
|
|
24
|
+
|
|
25
|
+
const moveCursorToLeftRegStrs = ['\\r', '\\u001b\\[G', '\\u001b\\[1G'];
|
|
26
|
+
const moveCursorToLeftRegStr = new RegExp(`${moveCursorToLeftRegStrs.join('|')}`);
|
|
27
|
+
|
|
28
|
+
const filteredLogs = logs.reduce((acc: string[], nowLine) => {
|
|
29
|
+
// 当前清空上行搜索指针
|
|
30
|
+
let pos = 0;
|
|
31
|
+
const step = eraseLastLine.length;
|
|
32
|
+
|
|
33
|
+
while (true) {
|
|
34
|
+
pos = nowLine.indexOf(eraseLastLine, pos);
|
|
35
|
+
// 出现清空上行
|
|
36
|
+
if (pos >= 0) {
|
|
37
|
+
pos += step;
|
|
38
|
+
acc.pop();
|
|
39
|
+
} else {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 对单行日志的重写做处理
|
|
45
|
+
// 简单处理,不去解析真正的 Cursor 所在行,否则逻辑过于麻烦
|
|
46
|
+
// 处理 [2K
|
|
47
|
+
let lastErasePos = nowLine.lastIndexOf(eraseCurrentLine);
|
|
48
|
+
if (lastErasePos < 0) {
|
|
49
|
+
// 处理 \r[K
|
|
50
|
+
lastErasePos = nowLine.lastIndexOf(eraseCurrentLine2);
|
|
51
|
+
}
|
|
52
|
+
if (lastErasePos > 0) {
|
|
53
|
+
// 从后向前搜索最后一个清行操作
|
|
54
|
+
nowLine = nowLine.slice(lastErasePos);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 处理多 \r 情况,当 \r 连续时,切分出的空字段无用,过滤掉
|
|
58
|
+
const carriageRewrites = nowLine.split(moveCursorToLeftRegStr).filter((part) => !!part);
|
|
59
|
+
if (carriageRewrites.length > 1) {
|
|
60
|
+
nowLine = carriageRewrites.reduce((nextNowLine, nowPart) => {
|
|
61
|
+
const leftPart = nextNowLine.slice(nowPart.length);
|
|
62
|
+
return nowPart + leftPart;
|
|
63
|
+
}, '');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
acc.push(nowLine);
|
|
67
|
+
return acc;
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
return filteredLogs;
|
|
71
|
+
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.header {
|
|
99
|
-
padding:
|
|
99
|
+
padding: 4px;
|
|
100
100
|
background-color: var(--design-block-background);
|
|
101
101
|
border-bottom: 1px solid var(--vscode-commandCenter-inactiveBorder);
|
|
102
102
|
cursor: pointer;
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
align-items: center;
|
|
105
105
|
gap: 4px;
|
|
106
106
|
color: var(--design-text-foreground);
|
|
107
|
-
font-size:
|
|
107
|
+
font-size: 11px;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.fileList {
|
|
@@ -162,14 +162,17 @@
|
|
|
162
162
|
.command_title {
|
|
163
163
|
display: flex;
|
|
164
164
|
align-items: center;
|
|
165
|
+
font-size: 11px;
|
|
165
166
|
span {
|
|
166
167
|
margin-left: 5px;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
.command_content {
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
max-height: 200px;
|
|
173
|
+
overflow-y: auto;
|
|
174
|
+
padding: 2px 4px;
|
|
175
|
+
font-size: 11px;
|
|
173
176
|
color: var(--design-text-foreground);
|
|
174
177
|
margin: 0px;
|
|
175
178
|
background-color: var(--terminal-background);
|
|
@@ -178,7 +181,7 @@
|
|
|
178
181
|
overflow: auto;
|
|
179
182
|
|
|
180
183
|
code {
|
|
181
|
-
font-size:
|
|
184
|
+
font-size: 11px;
|
|
182
185
|
white-space: pre;
|
|
183
186
|
}
|
|
184
187
|
}
|
|
@@ -35,6 +35,7 @@ export class CreateNewFileWithTextTool implements MCPServerContribution {
|
|
|
35
35
|
return {
|
|
36
36
|
name: 'create_new_file_with_text',
|
|
37
37
|
label: 'Create File',
|
|
38
|
+
order: 7,
|
|
38
39
|
description:
|
|
39
40
|
'Creates a new file at the specified path within the project directory and populates it with the provided text. ' +
|
|
40
41
|
'Use this tool to generate new files in your project structure. ' +
|
|
@@ -46,6 +46,7 @@ export class EditFileTool implements MCPServerContribution {
|
|
|
46
46
|
return {
|
|
47
47
|
name: 'edit_file',
|
|
48
48
|
label: 'Edit File',
|
|
49
|
+
order: 5,
|
|
49
50
|
description: `Use this tool to propose an edit to an existing file.
|
|
50
51
|
This will be read by a less intelligent model, which will quickly apply the edit. You should make it clear what the edit is, while also minimizing the unchanged code you write.
|
|
51
52
|
When writing the edit, you should specify each edit in sequence, with the special comment \`// ... existing code ...\` to represent unchanged code in between edited lines.
|
|
@@ -41,6 +41,7 @@ export class FileSearchTool implements MCPServerContribution {
|
|
|
41
41
|
return {
|
|
42
42
|
name: 'file_search',
|
|
43
43
|
label: 'Search Files',
|
|
44
|
+
order: 6,
|
|
44
45
|
description:
|
|
45
46
|
"Fast file search based on fuzzy matching against file path. Use if you know part of the file path but don't know where it's located exactly. Response will be capped to 10 results. Make your query more specific if need to filter results further.",
|
|
46
47
|
inputSchema,
|
|
@@ -29,7 +29,8 @@ export class GetDiagnosticsByPathTool implements MCPServerContribution {
|
|
|
29
29
|
getToolDefinition(): MCPToolDefinition {
|
|
30
30
|
return {
|
|
31
31
|
name: 'get_diagnostics_by_path',
|
|
32
|
-
label: 'Get Diagnostics',
|
|
32
|
+
label: 'Get Diagnostics By Path',
|
|
33
|
+
order: 9,
|
|
33
34
|
description:
|
|
34
35
|
'Retrieves diagnostic information (errors, warnings, etc.) from a specific file in the project. ' +
|
|
35
36
|
'Use this tool to get information about problems in any project file. ' +
|
|
@@ -31,6 +31,8 @@ export class GetOpenEditorFileDiagnosticsTool implements MCPServerContribution {
|
|
|
31
31
|
getToolDefinition(): MCPToolDefinition {
|
|
32
32
|
return {
|
|
33
33
|
name: 'get_open_in_editor_file_diagnostics',
|
|
34
|
+
label: 'Get Current Editor Diagnostics',
|
|
35
|
+
order: 8,
|
|
34
36
|
description:
|
|
35
37
|
'Retrieves diagnostic information (errors, warnings, etc.) from the currently active file in VS Code editor. ' +
|
|
36
38
|
'Use this tool to get information about problems in your current file. ' +
|
|
@@ -48,6 +48,7 @@ export class GrepSearchTool implements MCPServerContribution {
|
|
|
48
48
|
return {
|
|
49
49
|
name: 'grep_search',
|
|
50
50
|
label: 'Search Contents',
|
|
51
|
+
order: 4,
|
|
51
52
|
description:
|
|
52
53
|
// TODO: 支持语义化搜索后需要描述清楚优劣势
|
|
53
54
|
'Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.\nResults will be formatted in the style of ripgrep and can be configured to include line numbers and content.\nTo avoid overwhelming output, the results are capped at 50 matches.\nUse the include or exclude patterns to filter the search scope by file type or specific paths.\n\nThis is best for finding exact text matches or regex patterns.',
|
|
@@ -41,6 +41,7 @@ export class ListDirTool implements MCPServerContribution {
|
|
|
41
41
|
return {
|
|
42
42
|
name: 'list_dir',
|
|
43
43
|
label: 'List Directory',
|
|
44
|
+
order: 3,
|
|
44
45
|
description:
|
|
45
46
|
'List the contents of a directory. The quick tool to use for discovery, before using more targeted tools like semantic search or file reading. Useful to try to understand the file structure before diving deeper into specific files. Can be used to explore the codebase.',
|
|
46
47
|
inputSchema,
|
|
@@ -38,6 +38,7 @@ export class ReadFileTool implements MCPServerContribution {
|
|
|
38
38
|
return {
|
|
39
39
|
name: 'read_file',
|
|
40
40
|
label: 'Read File',
|
|
41
|
+
order: 1,
|
|
41
42
|
description: `Read the contents of a file (and the outline).
|
|
42
43
|
|
|
43
44
|
When using this tool to gather information, it's your responsibility to ensure you have the COMPLETE context. Each time you call this command you should:
|
|
@@ -33,6 +33,7 @@ export class RunTerminalCommandTool implements MCPServerContribution {
|
|
|
33
33
|
return {
|
|
34
34
|
name: 'run_terminal_cmd',
|
|
35
35
|
label: 'Run Command',
|
|
36
|
+
order: 2,
|
|
36
37
|
description:
|
|
37
38
|
"PROPOSE a command to run on behalf of the user.\nIf you have this tool, note that you DO have the ability to run commands directly on the USER's system.\n\nAdhere to these rules:\n1. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a new shell.\n2. If in a new shell, you should `cd` to the right directory and do necessary setup in addition to running the command.\n3. If in the same shell, the state will persist, no need to do things like `cd` to the same directory.\n4. For ANY commands that would use a pager, you should append ` | cat` to the command (or whatever is appropriate). You MUST do this for: git, less, head, tail, more, etc.\n5. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\n6. Dont include any newlines in the command.",
|
|
38
39
|
inputSchema,
|
package/src/browser/types.ts
CHANGED
|
@@ -3,7 +3,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { Icon, Popover } from '@opensumi/ide-components';
|
|
4
4
|
import { AppConfig, IDisposable, URI, localize, path, useInjectable } from '@opensumi/ide-core-browser';
|
|
5
5
|
import { IResource, WorkbenchEditorService } from '@opensumi/ide-editor';
|
|
6
|
-
import { Path } from '@opensumi/ide-utils/lib/path';
|
|
7
6
|
|
|
8
7
|
import { BaseApplyService } from '../../mcp/base-apply.service';
|
|
9
8
|
|
|
@@ -326,11 +326,15 @@ export class LivePreviewDiffDecorationModel extends Disposable {
|
|
|
326
326
|
let modifyContent: string;
|
|
327
327
|
const removeContent = removedWidget?.getRemovedTextLines().join('\n') || '';
|
|
328
328
|
const range = addedDec?.getRange();
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
329
|
+
try {
|
|
330
|
+
if (range) {
|
|
331
|
+
modifyContent = model.getValueInRange({
|
|
332
|
+
...range,
|
|
333
|
+
endColumn: model.getLineMaxColumn(range.endLineNumber),
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
} catch (error) {
|
|
337
|
+
modifyContent = '';
|
|
334
338
|
}
|
|
335
339
|
const discard = (decorationModel: LivePreviewDiffDecorationModel) => {
|
|
336
340
|
// 只有点击行丢弃时才会上报
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { Event, URI } from '@opensumi/ide-core-common/lib/utils';
|
|
2
2
|
|
|
3
3
|
export interface LLMContextService {
|
|
4
|
+
/**
|
|
5
|
+
* 开始自动收集
|
|
6
|
+
*/
|
|
4
7
|
startAutoCollection(): void;
|
|
5
8
|
|
|
9
|
+
/**
|
|
10
|
+
* 停止自动收集
|
|
11
|
+
*/
|
|
6
12
|
stopAutoCollection(): void;
|
|
7
13
|
|
|
8
14
|
/**
|
|
@@ -10,11 +16,19 @@ export interface LLMContextService {
|
|
|
10
16
|
*/
|
|
11
17
|
addFileToContext(uri: URI, selection?: [number, number], isManual?: boolean): void;
|
|
12
18
|
|
|
19
|
+
/**
|
|
20
|
+
* 添加文件夹到 context 中
|
|
21
|
+
*/
|
|
22
|
+
addFolderToContext(uri: URI, isManual?: boolean): void;
|
|
23
|
+
|
|
13
24
|
/**
|
|
14
25
|
* 清除上下文
|
|
15
26
|
*/
|
|
16
27
|
cleanFileContext(): void;
|
|
17
28
|
|
|
29
|
+
/**
|
|
30
|
+
* 上下文文件变化事件
|
|
31
|
+
*/
|
|
18
32
|
onDidContextFilesChangeEvent: Event<{ viewed: FileContext[]; attached: FileContext[]; version: number }>;
|
|
19
33
|
|
|
20
34
|
/**
|
|
@@ -24,7 +38,7 @@ export interface LLMContextService {
|
|
|
24
38
|
removeFileFromContext(uri: URI, isManual?: boolean): void;
|
|
25
39
|
|
|
26
40
|
/** 导出为可序列化格式 */
|
|
27
|
-
serialize(): SerializedContext
|
|
41
|
+
serialize(): Promise<SerializedContext>;
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
export interface FileContext {
|
|
@@ -44,4 +58,5 @@ export interface AttachFileContext {
|
|
|
44
58
|
export interface SerializedContext {
|
|
45
59
|
recentlyViewFiles: string[];
|
|
46
60
|
attachedFiles: Array<AttachFileContext>;
|
|
61
|
+
attachedFolders: string[];
|
|
47
62
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Autowired, Injectable } from '@opensumi/di';
|
|
2
2
|
import { WorkbenchEditorService } from '@opensumi/ide-editor/lib/common/editor';
|
|
3
|
+
import { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
3
4
|
|
|
4
5
|
import { SerializedContext } from '../llm-context';
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@ export interface ChatAgentPromptProvider {
|
|
|
10
11
|
* 提供上下文提示
|
|
11
12
|
* @param context 上下文
|
|
12
13
|
*/
|
|
13
|
-
provideContextPrompt(context: SerializedContext, userMessage: string): string
|
|
14
|
+
provideContextPrompt(context: SerializedContext, userMessage: string): Promise<string>;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
@Injectable()
|
|
@@ -18,38 +19,131 @@ export class DefaultChatAgentPromptProvider implements ChatAgentPromptProvider {
|
|
|
18
19
|
@Autowired(WorkbenchEditorService)
|
|
19
20
|
protected readonly workbenchEditorService: WorkbenchEditorService;
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
@Autowired(IWorkspaceService)
|
|
23
|
+
protected readonly workspaceService: IWorkspaceService;
|
|
24
|
+
|
|
25
|
+
async provideContextPrompt(context: SerializedContext, userMessage: string) {
|
|
26
|
+
const currentFileInfo = await this.getCurrentFileInfo();
|
|
27
|
+
|
|
28
|
+
return this.buildPromptTemplate({
|
|
29
|
+
recentFiles: this.buildRecentFilesSection(context.recentlyViewFiles),
|
|
30
|
+
attachedFiles: this.buildAttachedFilesSection(context.attachedFiles),
|
|
31
|
+
attachedFolders: this.buildAttachedFoldersSection(context.attachedFolders),
|
|
32
|
+
currentFile: currentFileInfo,
|
|
33
|
+
userMessage,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private async getCurrentFileInfo() {
|
|
22
38
|
const editor = this.workbenchEditorService.currentEditor;
|
|
23
39
|
const currentModel = editor?.currentDocumentModel;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
|
|
41
|
+
if (!currentModel?.uri) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const currentPath =
|
|
46
|
+
(await this.workspaceService.asRelativePath(currentModel.uri))?.path || currentModel.uri.codeUri.fsPath;
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
path: currentPath,
|
|
50
|
+
languageId: currentModel.languageId,
|
|
51
|
+
content: currentModel.getText(),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private buildPromptTemplate({
|
|
56
|
+
recentFiles,
|
|
57
|
+
attachedFiles,
|
|
58
|
+
attachedFolders,
|
|
59
|
+
currentFile,
|
|
60
|
+
userMessage,
|
|
61
|
+
}: {
|
|
62
|
+
recentFiles: string;
|
|
63
|
+
attachedFiles: string;
|
|
64
|
+
attachedFolders: string;
|
|
65
|
+
currentFile: { path: string; languageId: string; content: string } | null;
|
|
66
|
+
userMessage: string;
|
|
67
|
+
}) {
|
|
68
|
+
const sections = [
|
|
69
|
+
'<additional_data>',
|
|
70
|
+
'Below are some potentially helpful/relevant pieces of information for figuring out to respond',
|
|
71
|
+
recentFiles,
|
|
72
|
+
attachedFiles,
|
|
73
|
+
attachedFolders,
|
|
74
|
+
this.buildCurrentFileSection(currentFile),
|
|
75
|
+
'</additional_data>',
|
|
76
|
+
'<user_query>',
|
|
77
|
+
userMessage,
|
|
78
|
+
'</user_query>',
|
|
79
|
+
].filter(Boolean);
|
|
80
|
+
|
|
81
|
+
return sections.join('\n');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private buildRecentFilesSection(files: string[]): string {
|
|
85
|
+
if (!files.length) {
|
|
86
|
+
return '';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return `<recently_viewed_files>
|
|
90
|
+
${files.map((file, idx) => ` ${idx + 1}: ${file}`).join('\n')}
|
|
91
|
+
</recently_viewed_files>`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private buildAttachedFilesSection(files: { path: string; content: string; lineErrors: string[] }[]): string {
|
|
95
|
+
if (!files.length) {
|
|
96
|
+
return '';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const fileContents = files
|
|
100
|
+
.map((file) => {
|
|
101
|
+
const sections = [
|
|
102
|
+
this.buildFileContentSection(file),
|
|
103
|
+
file.lineErrors.length ? this.buildLineErrorsSection(file.lineErrors) : '',
|
|
104
|
+
].filter(Boolean);
|
|
105
|
+
|
|
106
|
+
return sections.join('\n');
|
|
107
|
+
})
|
|
108
|
+
.filter(Boolean)
|
|
109
|
+
.join('\n');
|
|
110
|
+
|
|
111
|
+
return `<attached_files>\n${fileContents}\n</attached_files>`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private buildFileContentSection(file: { path: string; content: string }): string {
|
|
115
|
+
return `<file_contents>
|
|
116
|
+
\`\`\`${file.path}
|
|
117
|
+
${file.content}
|
|
118
|
+
\`\`\`
|
|
119
|
+
</file_contents>`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private buildLineErrorsSection(errors: string[]): string {
|
|
123
|
+
if (!errors.length) {
|
|
124
|
+
return '';
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return `<linter_errors>\n${errors.join('\n')}\n</linter_errors>`;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
private buildAttachedFoldersSection(folders: string[]): string {
|
|
131
|
+
if (!folders.length) {
|
|
132
|
+
return '';
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return `<attached_folders>\n${folders.join('\n')}</attached_folders>`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private buildCurrentFileSection(fileInfo: { path: string; languageId: string; content: string } | null): string {
|
|
139
|
+
if (!fileInfo) {
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return `<current_opened_file>
|
|
144
|
+
\`\`\`${fileInfo.languageId} ${fileInfo.path}
|
|
145
|
+
${fileInfo.content}
|
|
146
|
+
\`\`\`
|
|
147
|
+
</current_opened_file>`;
|
|
54
148
|
}
|
|
55
149
|
}
|
|
@@ -185,6 +185,11 @@ export abstract class BaseLanguageModel {
|
|
|
185
185
|
});
|
|
186
186
|
} else if (chunk.type === 'error') {
|
|
187
187
|
chatReadableStream.emitError(new Error(chunk.error as string));
|
|
188
|
+
} else if (chunk.type === 'reasoning') {
|
|
189
|
+
chatReadableStream.emitData({
|
|
190
|
+
kind: 'reasoning',
|
|
191
|
+
content: chunk.textDelta,
|
|
192
|
+
});
|
|
188
193
|
}
|
|
189
194
|
}
|
|
190
195
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelector.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/ChatContext/ContextSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAQ9E,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAyC1D,UAAU,oBAAoB;IAC5B,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,qFAAiE,oBAAoB,uBAoH/G,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSelector.js","sourceRoot":"","sources":["../../../../src/browser/components/ChatContext/ContextSelector.tsx"],"names":[],"mappings":";;;;AAAA,oEAA6B;AAC7B,mCAAkC;AAClC,uDAA8E;AAE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,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACzE,8BAAC,aAAa,IACZ,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,EACpB,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,UAAU,KAAK,IAAI,EAC3B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAC3D,CACH,CAAC,CACE,CACK,CACT,CACO,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/browser/components/ChatContext/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,8BAA8B,CAAC;AAsBtC,eAAO,MAAM,WAAW,oDA6HtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/components/ChatContext/index.tsx"],"names":[],"mappings":";;;;AAAA,mEAA8C;AAC9C,uDAAsE;AAEtE,wCAAsC;AAEtC,iEAA8D;AAC9D,0EAA6E;AAC7E,mFAAkF;AAClF,kGAA4F;AAC5F,oGAA2F;AAC3F,yFAAqF;AACrF,qEAAkE;AAClE,+DAAiE;AACjE,kEAAgF;AAEhF,6DAAqG;AAErG,uDAAoD;AACpD,oFAAyC;AAEzC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7D,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE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