@opensumi/ide-ai-native 3.8.3-next-1741772268.0 → 3.8.3-next-1741774971.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.view.d.ts.map +1 -1
- package/lib/browser/chat/chat.view.js +55 -18
- package/lib/browser/chat/chat.view.js.map +1 -1
- package/lib/browser/components/ChatEditor.d.ts +11 -2
- package/lib/browser/components/ChatEditor.d.ts.map +1 -1
- package/lib/browser/components/ChatEditor.js +66 -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 +224 -0
- package/lib/browser/components/ChatMentionInput.js.map +1 -0
- package/lib/browser/components/ChatThinking.d.ts +1 -1
- package/lib/browser/components/ChatThinking.d.ts.map +1 -1
- package/lib/browser/components/ChatThinking.js +8 -2
- package/lib/browser/components/ChatThinking.js.map +1 -1
- package/lib/browser/components/change-list.module.less +2 -0
- 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 +32 -2
- 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 +763 -0
- package/lib/browser/components/mention-input/mention-input.js.map +1 -0
- package/lib/browser/components/mention-input/mention-input.module.less +329 -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 +78 -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/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 -30
- package/lib/common/prompts/context-prompt-provider.js.map +1 -1
- package/lib/node/mcp-server.sse.d.ts.map +1 -1
- package/lib/node/mcp-server.sse.js +2 -2
- package/lib/node/mcp-server.sse.js.map +1 -1
- package/package.json +23 -23
- package/src/browser/chat/chat-agent.service.ts +7 -7
- package/src/browser/chat/chat.view.tsx +74 -21
- package/src/browser/components/ChatEditor.tsx +126 -9
- package/src/browser/components/ChatMentionInput.tsx +271 -0
- package/src/browser/components/ChatThinking.tsx +10 -4
- package/src/browser/components/change-list.module.less +2 -0
- package/src/browser/components/{ChatContext → chat-context}/index.tsx +1 -1
- package/src/browser/components/components.module.less +32 -2
- package/src/browser/components/mention-input/mention-input.module.less +329 -0
- package/src/browser/components/mention-input/mention-input.tsx +952 -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 +84 -0
- package/src/browser/context/llm-context.service.ts +81 -3
- package/src/common/llm-context.ts +16 -1
- package/src/common/prompts/context-prompt-provider.ts +126 -36
- package/src/node/mcp-server.sse.ts +1 -2
- 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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import cls from 'classnames';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Icon, getIcon } from '@opensumi/ide-core-browser/lib/components';
|
|
5
|
+
|
|
6
|
+
import styles from './mention-input.module.less';
|
|
7
|
+
import { MentionItem as MentionItemType } from './types';
|
|
8
|
+
|
|
9
|
+
interface MentionItemProps {
|
|
10
|
+
item: MentionItemType;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
onClick: (item: MentionItemType) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const MentionItem: React.FC<MentionItemProps> = ({ item, isActive, onClick }) => (
|
|
16
|
+
<div className={`${styles.mention_item} ${isActive ? styles.active : ''}`} onClick={() => onClick(item)}>
|
|
17
|
+
<div className={styles.mention_item_left}>
|
|
18
|
+
<Icon className={cls(styles.mention_item_icon, item.icon)} />
|
|
19
|
+
<span className={styles.mention_item_text}>{item.text}</span>
|
|
20
|
+
<span className={styles.mention_item_description}>{item.description}</span>
|
|
21
|
+
</div>
|
|
22
|
+
{item.getItems && <Icon className={cls(styles.mention_item_right, getIcon('arrowright'))} />}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import styles from './mention-input.module.less';
|
|
4
|
+
import { MentionItem } from './mention-item';
|
|
5
|
+
import { MentionItem as MentionItemType, MentionPosition } from './types';
|
|
6
|
+
|
|
7
|
+
interface MentionPanelProps {
|
|
8
|
+
items: MentionItemType[];
|
|
9
|
+
activeIndex: number;
|
|
10
|
+
onSelectItem: (item: MentionItemType, isTriggerByClick?: boolean) => void;
|
|
11
|
+
position: MentionPosition;
|
|
12
|
+
filter: string;
|
|
13
|
+
visible: boolean;
|
|
14
|
+
level: number;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const MentionPanel: React.FC<MentionPanelProps> = ({
|
|
19
|
+
items,
|
|
20
|
+
activeIndex,
|
|
21
|
+
onSelectItem,
|
|
22
|
+
position,
|
|
23
|
+
filter,
|
|
24
|
+
visible,
|
|
25
|
+
level,
|
|
26
|
+
loading = false,
|
|
27
|
+
}) => {
|
|
28
|
+
const panelRef = React.useRef<HTMLDivElement>(null);
|
|
29
|
+
|
|
30
|
+
// 当活动项改变时滚动到可见区域
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
if (visible && panelRef.current) {
|
|
33
|
+
const activeItem = panelRef.current.querySelector(`.${styles.mention_item}.${styles.active}`);
|
|
34
|
+
if (activeItem) {
|
|
35
|
+
activeItem.scrollIntoView({ block: 'nearest' });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, [activeIndex, visible]);
|
|
39
|
+
|
|
40
|
+
if (!visible) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 根据过滤条件筛选项目
|
|
45
|
+
const getFilteredItems = () => {
|
|
46
|
+
let filteredItems = items;
|
|
47
|
+
|
|
48
|
+
if (level === 0) {
|
|
49
|
+
// 一级菜单根据 @ 后面的文本过滤
|
|
50
|
+
if (filter && filter.length > 1) {
|
|
51
|
+
const searchText = filter.substring(1).toLowerCase();
|
|
52
|
+
filteredItems = items.filter((item) => item.text.toLowerCase().includes(searchText));
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
// 二级菜单根据 @file: 后面的文本过滤
|
|
56
|
+
if (filter && filter.length > 0) {
|
|
57
|
+
filteredItems = items.filter((item) => item.text.toLowerCase().includes(filter.toLowerCase()));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return filteredItems;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const filteredItems = getFilteredItems();
|
|
65
|
+
|
|
66
|
+
if (level === 0 && filteredItems.length === 0) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div ref={panelRef} className={styles.mention_panel} style={{ top: position.top, left: position.left }}>
|
|
72
|
+
{loading && <div className={styles.loading_bar}></div>}
|
|
73
|
+
{items.length > 0 ? (
|
|
74
|
+
<ul className={styles.mention_list}>
|
|
75
|
+
{items.map((item, index) => (
|
|
76
|
+
<MentionItem
|
|
77
|
+
key={item.id}
|
|
78
|
+
item={item}
|
|
79
|
+
isActive={index === activeIndex}
|
|
80
|
+
onClick={() => onSelectItem(item, true)}
|
|
81
|
+
/>
|
|
82
|
+
))}
|
|
83
|
+
</ul>
|
|
84
|
+
) : (
|
|
85
|
+
<div className={styles.no_results}>{loading ? '正在搜索...' : '无匹配结果'}</div>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LabelService } from '@opensumi/ide-core-browser';
|
|
2
|
+
import type { IWorkspaceService } from '@opensumi/ide-workspace';
|
|
3
|
+
|
|
4
|
+
export interface MentionItem {
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
contextId?: string;
|
|
11
|
+
icon?: string;
|
|
12
|
+
getHighestLevelItems?: () => MentionItem[];
|
|
13
|
+
getItems?: (searchText: string) => Promise<MentionItem[]>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SecondLevelMenuConfig {
|
|
17
|
+
getDefaultItems: () => MentionItem[];
|
|
18
|
+
getHighestLevelItems: () => MentionItem[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface MentionPosition {
|
|
22
|
+
top: number;
|
|
23
|
+
left: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MentionState {
|
|
27
|
+
active: boolean;
|
|
28
|
+
startPos: number | null;
|
|
29
|
+
filter: string;
|
|
30
|
+
position: MentionPosition;
|
|
31
|
+
activeIndex: number;
|
|
32
|
+
level: number; // 0: 一级菜单, 1: 二级菜单
|
|
33
|
+
parentType: string | null; // 二级菜单的父类型
|
|
34
|
+
secondLevelFilter: string; // 二级菜单的筛选文本
|
|
35
|
+
inlineSearchActive: boolean; // 是否在输入框中进行二级搜索
|
|
36
|
+
inlineSearchStartPos: number | null; // 内联搜索的起始位置
|
|
37
|
+
loading: boolean; // 加载状态
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface ModelOption {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum FooterButtonPosition {
|
|
46
|
+
LEFT = 'left',
|
|
47
|
+
RIGHT = 'right',
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export enum MentionType {
|
|
51
|
+
FILE = 'file',
|
|
52
|
+
FOLDER = 'folder',
|
|
53
|
+
CODE = 'code',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface FooterButton {
|
|
57
|
+
id: string;
|
|
58
|
+
icon: string;
|
|
59
|
+
title: string;
|
|
60
|
+
onClick?: () => void;
|
|
61
|
+
position: FooterButtonPosition;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface FooterConfig {
|
|
65
|
+
modelOptions?: ModelOption[];
|
|
66
|
+
defaultModel?: string;
|
|
67
|
+
buttons?: FooterButton[];
|
|
68
|
+
showModelSelector?: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface MentionInputProps {
|
|
72
|
+
mentionItems?: MentionItem[]; // 简化为单一菜单项配置
|
|
73
|
+
onSend?: (content: string, config?: { model: string; [key: string]: any }) => void;
|
|
74
|
+
onStop?: () => void;
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
loading?: boolean;
|
|
77
|
+
onSelectionChange?: (value: string) => void;
|
|
78
|
+
footerConfig?: FooterConfig; // 新增配置项
|
|
79
|
+
mentionKeyword?: string;
|
|
80
|
+
labelService?: LabelService;
|
|
81
|
+
workspaceService?: IWorkspaceService;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const MENTION_KEYWORD = '@';
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
IEditorDocumentModelService,
|
|
11
11
|
} from '@opensumi/ide-editor/lib/browser/doc-model/types';
|
|
12
12
|
import { EditorSelectionChangeEvent } from '@opensumi/ide-editor/lib/browser/types';
|
|
13
|
+
import { FileType, IFileServiceClient } from '@opensumi/ide-file-service';
|
|
13
14
|
import { IMarkerService } from '@opensumi/ide-markers/lib/common/types';
|
|
14
15
|
import { Range } from '@opensumi/ide-monaco';
|
|
15
16
|
|
|
@@ -26,13 +27,18 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
26
27
|
@Autowired(IMarkerService)
|
|
27
28
|
protected readonly markerService: IMarkerService;
|
|
28
29
|
|
|
30
|
+
@Autowired(IFileServiceClient)
|
|
31
|
+
protected readonly fileService: IFileServiceClient;
|
|
32
|
+
|
|
29
33
|
private isAutoCollecting = false;
|
|
30
34
|
|
|
31
35
|
private contextVersion = 0;
|
|
32
36
|
|
|
33
37
|
private readonly maxAttachFilesLimit = 10;
|
|
38
|
+
private readonly maxAttachFoldersLimit = 10;
|
|
34
39
|
private readonly maxViewFilesLimit = 20;
|
|
35
|
-
private
|
|
40
|
+
private attachedFiles: FileContext[] = [];
|
|
41
|
+
private attachedFolders: FileContext[] = [];
|
|
36
42
|
private readonly recentlyViewFiles: FileContext[] = [];
|
|
37
43
|
private readonly onDidContextFilesChangeEmitter = new Emitter<{
|
|
38
44
|
viewed: FileContext[];
|
|
@@ -53,6 +59,18 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
private addFolderToList(folder: FileContext, list: FileContext[], maxLimit: number) {
|
|
63
|
+
const existingIndex = list.findIndex((f) => f.uri.toString() === folder.uri.toString());
|
|
64
|
+
if (existingIndex > -1) {
|
|
65
|
+
list.splice(existingIndex, 1);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
list.push(folder);
|
|
69
|
+
if (list.length > maxLimit) {
|
|
70
|
+
list.shift();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
56
74
|
addFileToContext(uri: URI, selection?: [number, number], isManual = false): void {
|
|
57
75
|
if (!uri) {
|
|
58
76
|
return;
|
|
@@ -70,12 +88,24 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
70
88
|
this.notifyContextChange();
|
|
71
89
|
}
|
|
72
90
|
|
|
91
|
+
addFolderToContext(uri: URI): void {
|
|
92
|
+
if (!uri) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const file = { uri };
|
|
97
|
+
|
|
98
|
+
this.addFolderToList(file, this.attachedFolders, this.maxAttachFoldersLimit);
|
|
99
|
+
this.notifyContextChange();
|
|
100
|
+
}
|
|
101
|
+
|
|
73
102
|
private notifyContextChange(): void {
|
|
74
103
|
this.onDidContextFilesChangeEmitter.fire(this.getAllContextFiles());
|
|
75
104
|
}
|
|
76
105
|
|
|
77
106
|
cleanFileContext() {
|
|
78
|
-
this.attachedFiles
|
|
107
|
+
this.attachedFiles = [];
|
|
108
|
+
this.attachedFolders = [];
|
|
79
109
|
this.notifyContextChange();
|
|
80
110
|
}
|
|
81
111
|
|
|
@@ -83,6 +113,7 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
83
113
|
return {
|
|
84
114
|
viewed: this.recentlyViewFiles,
|
|
85
115
|
attached: this.attachedFiles,
|
|
116
|
+
attachedFolders: this.attachedFolders,
|
|
86
117
|
version: this.contextVersion++,
|
|
87
118
|
};
|
|
88
119
|
}
|
|
@@ -160,16 +191,63 @@ export class LLMContextServiceImpl extends WithEventBus implements LLMContextSer
|
|
|
160
191
|
this.dispose();
|
|
161
192
|
}
|
|
162
193
|
|
|
163
|
-
serialize(): SerializedContext {
|
|
194
|
+
async serialize(): Promise<SerializedContext> {
|
|
164
195
|
const files = this.getAllContextFiles();
|
|
165
196
|
const workspaceRoot = URI.file(this.appConfig.workspaceDir);
|
|
166
197
|
|
|
167
198
|
return {
|
|
168
199
|
recentlyViewFiles: this.serializeRecentlyViewFiles(files.viewed, workspaceRoot),
|
|
169
200
|
attachedFiles: this.serializeAttachedFiles(files.attached, workspaceRoot),
|
|
201
|
+
attachedFolders: await this.serializeAttachedFolders(files.attachedFolders, workspaceRoot),
|
|
170
202
|
};
|
|
171
203
|
}
|
|
172
204
|
|
|
205
|
+
private async serializeAttachedFolders(folders: FileContext[], workspaceRoot: URI): Promise<string[]> {
|
|
206
|
+
// 去重
|
|
207
|
+
const folderPath = Array.from(new Set(folders.map((folder) => folder.uri.toString())));
|
|
208
|
+
return Promise.all(
|
|
209
|
+
folderPath.map(async (folder) => {
|
|
210
|
+
const folderUri = new URI(folder);
|
|
211
|
+
const root = workspaceRoot.relative(folderUri)?.toString() || '/';
|
|
212
|
+
return `\`\`\`\n${root}\n${(await this.getPartiaFolderStructure(folderUri.codeUri.fsPath))
|
|
213
|
+
.map((line) => `- ${line}`)
|
|
214
|
+
.join('\n')}\n\`\`\`\n`;
|
|
215
|
+
}),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private async getPartiaFolderStructure(folder: string, level = 2): Promise<string[]> {
|
|
220
|
+
const result: string[] = [];
|
|
221
|
+
const stat = await this.fileService.getFileStat(folder);
|
|
222
|
+
|
|
223
|
+
for (const child of stat?.children || []) {
|
|
224
|
+
const relativePath = new URI(folder).relative(new URI(child.uri))!.toString();
|
|
225
|
+
|
|
226
|
+
if (child.isSymbolicLink) {
|
|
227
|
+
// 处理软链接
|
|
228
|
+
const target = await this.fileService.getFileStat(child.realUri || child.uri);
|
|
229
|
+
if (target) {
|
|
230
|
+
result.push(`${relativePath} -> ${target} (symbolic link)`);
|
|
231
|
+
} else {
|
|
232
|
+
result.push(`${relativePath} (broken symbolic link)`);
|
|
233
|
+
}
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (child.type === FileType.Directory) {
|
|
238
|
+
result.push(`${relativePath}/`);
|
|
239
|
+
if (level > 1) {
|
|
240
|
+
const subDirStructure = await this.getPartiaFolderStructure(child.uri, level - 1);
|
|
241
|
+
result.push(...subDirStructure.map((subEntry) => `${relativePath}/${subEntry}`));
|
|
242
|
+
}
|
|
243
|
+
} else if (child.type === FileType.File) {
|
|
244
|
+
result.push(relativePath);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return result;
|
|
249
|
+
}
|
|
250
|
+
|
|
173
251
|
private serializeRecentlyViewFiles(files: FileContext[], workspaceRoot: URI): string[] {
|
|
174
252
|
return files
|
|
175
253
|
.map((file) => workspaceRoot.relative(file.uri)?.toString() || file.uri.parent.toString())
|
|
@@ -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,42 +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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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>`;
|
|
58
148
|
}
|
|
59
149
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// have to import with extension since the exports map is ./* -> ./dist/cjs/*
|
|
2
2
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
3
|
+
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
|
|
3
4
|
import { EventSource } from 'eventsource';
|
|
4
5
|
|
|
5
6
|
import { ILogger } from '@opensumi/ide-core-common';
|
|
@@ -33,8 +34,6 @@ export class SSEMCPServer implements IMCPServer {
|
|
|
33
34
|
}
|
|
34
35
|
this.logger?.log(`Starting server "${this.name}" with serverHost: ${this.serverHost}`);
|
|
35
36
|
|
|
36
|
-
const SSEClientTransport = (await import('@modelcontextprotocol/sdk/client/sse.js')).SSEClientTransport;
|
|
37
|
-
|
|
38
37
|
const transport = new SSEClientTransport(new URL(this.serverHost));
|
|
39
38
|
transport.onerror = (error) => {
|
|
40
39
|
this.logger?.error('Transport Error:', error);
|
|
@@ -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,o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AE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC1E,uCAAK,SAAS,EAAE,2BAAM,CAAC,YAAY;oBAChC,SAAS,IAAI,uCAAK,SAAS,EAAE,2BAAM,CAAC,oBAAoB,GAAI;oBAC7D,wCAAM,SAAS,EAAE,2BAAM,CAAC,SAAS,IAC9B,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,qBAAqB,CAC/D;oBACN,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,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/Ch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